Suppose you were asked to enhance the hash set class


Question: We said that a class that stores data for you should also manipulate it for you, as appropriate. One might conclude from this statement that a Hash Set, for example, should not just store data, but should manipulate the data for you somehow. For example, consider a Hash Set containing a collection of Person objects. The client of such a class might find it necessary to extract just the names of the people and put them in a new Hash Set. Ideally, the Hash Set class would have a method to do this extraction for you. However, there are an unlimited number of ways that the Person objects might be manipulated, and so you cannot fill the Hash Set class with methods covering all possible cases.

a. Suppose you were asked to enhance the Hash Set class. Suggest one new method for that class that could be used to manipulate the data in a variety of ways.

b. Why wasn't such a method ever added to the Hash Set class?

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Suppose you were asked to enhance the hash set class
Reference No:- TGS02580194

Expected delivery within 24 Hours