lpublic
void insert(String item)
l// If the list is not full, puts item in its proper
l// place; otherwise list is unchanged.
l// Assumption: item is not already in the list.
l{
if (! isFull())
l {// find proper location for
new element
l
int index = numItems - 1;
l
while (index >= 0
&&
l item.compareTo(listItems[index]) <
0)
l {
l listItems[index + 1] =
listItems[index];
l index--;
l }
l listItems[index +1] = item; // insert item
l numItems++; }
l}