Question: Why not have a single Co17ection data type that implements methods to add items, remove the most recently inserted item, remove the least recently inserted
Why not have a single Co17ection data type that implements methods to add items, remove the most recently inserted item, remove the least recently inserted item, remove a random item, iterate over the items, return the number of items in the collection, and whatever other operations we might desire? Then we could get them all implemented in a single class that could be used by many clients.
Step by Step Solution
3.38 Rating (167 Votes )
There are 3 Steps involved in it
Great question In theory having a single universal Collection data type that implements a wide varie... View full answer
Get step-by-step solutions from verified subject matter experts
