此表很好建立,而且进行查找,删除,插入都容易理解,但是有一个缺点:删除和插入需要调动好些元素
/*线性表的顺序实现*/
 #include<stdio.h>
 #include<stdlib.h>#define MAXSIZE 15
struct SqList
 {
int *Ele;
int Length;
 }; 
 /*线性表的初始化*/
 void Init_Sq(SqList &L)
 {
L.Ele=(int *)malloc(sizeof(int)*MAXSIZE);
L.Length=0;
 }
 /*线性表的建立*/
 void Build_Sq(SqList &L) 
 {
int i,sum;
printf("请输入长度及数据\n");
scanf("%d",&sum);
L.Length=sum;
for(i=0;i<sum;i++)
scanf("%d",&L.Ele[i]);
 }
 /*线性表的输出*/
 void Print_Sq(SqList &L)
 {
int i;
for(i=0;i<L.Length;i++)
printf("%d ",L.Ele[i]);
printf("\n");
 }
 /*线性表的查找*/
 int Locate_Sq(SqList &L,int num)
 {
int i;
for(i=0;i<L.Length;i++)
if(num==L.Ele[i])
return i+1;
return 0;
 } 
 /*线性表的插入:此插入为前插*/
 int Insert_Sq(SqList &L,int Location,int num)
 {
if(Location<1||Location>L.Length+1)
return 0;
if(L.Length==MAXSIZE)
return 0;
int i;
for(i=L.Length;i>Location-1;i--)
L.Ele[i]=L.Ele[i-1];
L.Ele[Location-1]=num;
++L.Length;
return 1;
 }
 /*线性表的删除*/
 int Delete_Sq(SqList &L,int Location)
 {
int i;
if(Location<1||Location>L.Length)
return 0;
for(i=Location-1;i<L.Length-1;i++)
L.Ele[i]=L.Ele[i+1];
--L.Length;
return 1;
 }
 int main()
 {
SqList L;
Init_Sq(L);
Build_Sq(L);
Print_Sq(L);
printf("%d\n",Locate_Sq(L,3));
if(Insert_Sq(L,3,100))
Print_Sq(L);
if(Delete_Sq(L,3))
Print_Sq(L); 
return 0;
 }