9 template<
class ItemType>
14 template<
class ItemType>
20 template<
class ItemType>
23 return itemCount == 0;
26 template<
class ItemType>
29 bool hasRoomToAdd = (itemCount < maxItems);
32 items[itemCount] = newEntry;
39 template<
class ItemType>
42 int locatedIndex = getIndexOf(anEntry);
43 bool canRemoveItem = !isEmpty() && (locatedIndex > -1);
47 items[locatedIndex] = items[itemCount];
53 template<
class ItemType>
59 template<
class ItemType>
64 while (searchIndex < itemCount)
66 if (items[searchIndex] == anEntry)
77 template<
class ItemType>
80 return getIndexOf(anEntry) > -1;
107 template<
class ItemType>
110 vector<ItemType> bagContents;
111 for (
int i = 0; i < itemCount; i++)
112 bagContents.push_back(items[i]);
117 template<
class ItemType>
124 while (!found && (searchIndex < itemCount))
126 if (items[searchIndex] == target)
129 result = searchIndex;