bool Insert(List L, ElementType X)
{
int i, index = L->Last;
if (index == MAXSIZE - 1)
return false;
for (i = 0; i <= index; i++)
{
if (L->Data[i] == X)
return false;
if (L->Data[i] < X)
break;
}
for (int j = index + 1; j >= i; j--)
{
if (j == i)
L->Data[i] = X;
else
L->Data[j] = L->Data[j - 1];
}
L->Last++;
return true;
}