// Solution of Assignment 4 void UnsortedType::insertItem(ItemType item) { if (isFull()) cout << "The list is full.\n"; else { bool found; retrieveItem(item,found); if (!found) { info[length] = item; length++; } else cout << "The item to be inserted is already there.\n"; } } void UnsortedType::deleteItem(ItemType item) { bool found; retrieveItem(item,found); if (found) { int index = 0; while (item.comparedTo(info[index]) != EQUAL) index++; info[index] = info[length - 1]; length--; } else cout << "The item to be deleted is not in the list.\n"; } void UnsortedType::findAt(int k, ItemType& item) { if (k >=0 && k < lenght) item = info[k]; else cout << "The index is out of range.\n"; }