Status ListInsert_SortedSq(SqList &L, ElemType e)
{
if (L.length == L.listsize)
{
L.elem = (ElemType *)realloc(L.elem, (1 + L.length) * sizeof(ElemType));
}
int j = L.length;
for (; j > 0; j--)
{
if (e > L.elem[j - 1])
{
break;
}
else
{
L.elem[j] = L.elem[j - 1];
}
}
L.elem[j] = e;
L.length = L.length + 1;
return OK;
}