【问题描述】
设有递增有序顺序表,实现其插入元素后依然有序。
【输入形式】
第一行输入一个N(N不大于100);
第二行输入N个整数(假设输入序列按照递增顺序,以空格分隔);
第三行输入一个整数M(欲插入数据);
【输出形式】
输出插入M后的顺序表。
【样例输入】
5
12 25 35 98 125
77
【样例输出】
12 25 35 77 98 125
#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 100
#define INCREM 10
#define INIT_SIZE 100
#define OK 1
#define ERROR 0
typedef int ElemType;
typedef struct Sqlist
{
ElemType *slist;
int length;
int listsize;
}Sqlist;
int InitList(Sqlist *L)
{
L->slist=(ElemType*)malloc(INIT_SIZE*sizeof(ElemType