Bag<T> implementation
Bag<T> implementation. Add(T item) Enlarge bag if necessary; allocate larger array Remove(T item) Reduce bag if necessary; allocate smaller array Iterator Visit each element of the Bag, in turn. Iterators. Iterator pattern. Horstmann book, pages 178-179 Carrano text, chapter 8
203 views • 7 slides