Pseudocode for Bag::insert
assert(size( ) < CAPACITY);
Place new_entry in the appropriate location of the data array.
Add one to the member variable count.
What is the “appropriate
location” of the data array ?
Previous slide
Next slide
Back to first slide
View graphic version