Why are only a few changes necessary to reuse the code in Listing 3-2? Howwould you implement the changes using the “find and replace” functionality of a text editoror IDE?
What will be an ideal response?
Because both ArrayBag and LinkedBag are derived from BagInterface, they each implement the same methods. Moreover, BagInterfaceis a template that represents the data type of the entries in the bag generically with the identifier ItemType. The program in Listing 3-2 was written in this context. Thus, by replacing ArrayBagwith LinkedBagin Listing 3-2, you will get a program to test the core methods of LinkedBag.
Computer Science & Information Technology
You might also like to view...
Windows 8 and Office 2013 are ________-enabled applications
A) swipe B) tap C) touch D) pinch
Computer Science & Information Technology
The ________ performs addition, subtraction, multiplication, and division and also makes logical and comparison decisions
A) motherboard B) system unit C) control unit D) arithmetic logical unit (ALU)
Computer Science & Information Technology