//顺序表的就地逆置#include#include #define LIST_INIT_SIZE 100#define LISTINCREMENT 10#define OVERFLOW 0#define OK 1typedef int Status;typedef int ElemType;typedef struct{ ElemType *elem; int length; int listsize;}Sqlist;//定义结构类型Sqlist L;Status InitList_Sq(){ L.elem=(ElemType *)malloc(LIST_INIT_SIZE*sizeof(ElemType)) ; if(!L.elem) exit(OVERFLOW); L.length=0; L.listsize=LIST_INIT_SIZE; return OK; }//顺序表初始化操作void Input(){ int i=0,n; printf("Plese input datas except 0\n"); printf("Type 0 for stopping input!\n"); scanf("%d",&n); while(n!=0&&i<100){ L.elem[i]=n; L.length++; i++; scanf("%d",&n); } printf("The contents of the sqlist are\n"); for(i = 0; i < L.length; i++) printf("%d ", L.elem[i]); printf("\n");}//输入数据void Reverse(Sqlist *L){ int i,temp; int low=0; int high=L->length-1; for(i=0; i length/2;i++){ temp=L->elem[low]; L->elem[low]=L->elem[high]; L->elem[high]=temp; low++; high--; }}//就地逆置void Output(Sqlist L){ printf("The contents of the reversed sqlist are\n"); int i; for(i=0;i