线性表的顺序存储结构
必做题)设计并验证以下算法:设顺序表A和B中的数据元素为整数且单调递增有序,将这两张表合并成顺序表C。 (1) 顺序表C单调递减有序。 (2) 根据键盘输入数据建立顺序表A和B。 (3) 输出顺序表A、B和C。 # include "stdio.h" # include "malloc.h" # include "stdlib.h" # define STACK_INIT_SIZE 100 # define STACKINCREMENT 10 # define OVERFLOW -1 # define OK 1 typedef int ElemType ; typedef int Status ; typedef struct { ElemType * elem ; int length ; int listsize ; } SqStack ; Status InitList_Sq ( SqStack * ) ; void Create_Sq ( SqStack * ) ; void Print_Sq ( SqStack ) ; void Merge_Sq ( SqStack , SqStack , SqStack * ) ; int Check_Sq ( SqStack ) ; int main ( ) { int ans ; SqStack la , lb , lc ;