实验0-线性表-二叉树的基本操作1.pdfVIP

  • 2
  • 0
  • 约5.76千字
  • 约 18页
  • 2020-11-12 发布于湖北
  • 举报
实验 0- 线性表 - 二叉树的基本操 作 1 1.普通线性表顺序存储结构的基本操作 #includeiostream using namespace std; #define elemtype int struct sequenlist { elemtype a[maxsize]; int len; }; //求线性表的长度 int Length(sequenlist L) { return L.len; } //在线性表第 i 个位置插入新元素 x void Insert(sequenlist L,elemtype x,int i) { if(L.len=maxsize-1 coutoverflowendl; else if((i1)||(iL.len+1)) coutposition is not correct!endl; else { for(j=L.len;j=i;j--) L.a[j+1]=L.a[j]; L.a[i]=x; L.len++; } } //将线性表第

文档评论(0)

1亿VIP精品文档

相关文档