17. Implement the ADT list according to the specifications in List Interface using a resizable array that grows in the following fashion. When the array is full, create a new empty array of the same...


17. Implement the ADT list according to the specifications in List Interface using a resizable array that grows in the following fashion. When the array is full, create a new empty array of the same size that serves as an extension to the original one. When the first extension becomes full, create a second extension, and so on as needed. Figure 11-6 illustrates an array and its extensions.


Figure 11-6


An array and extensions for Project 17


This approach can be more efficient in both time and space than the resizable array-based list discussed in this chapter, since the entries are not copied, new arrays are smaller, and the memory for an extension that is no longer needed can be reclaimed. Managing the extensions provides several interesting challenges. For example, how do you track the extensions? Can you manage them in another type of ADT? Must you revise the methods add and remove, so that entries shift between extensions?

Nov 25, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here