Comparing the storage cost of two growth policies

A task application compares two array-backed implementations of the List ADT. Each starts with five task references stored in a backing array of capacity six reference slots. Each implementation then performs fifteen appends, with no removals.


When an append finds the array full, the implementation allocates a larger array and copies every existing reference exactly once. It then adopts the new array, releases the old array, and writes the appended reference. Task records themselves are not copied.


The policies differ only in their new capacities:

  • Doubling policy: the new capacity is twice the old capacity.
  • Fixed-increment policy: the new capacity is the old capacity plus six slots.

The peak allocated capacity is the greatest total number of reference slots allocated at the same time. During resizing, the old and new arrays coexist until copying finishes. Count all slots in both arrays, including unused slots. Assume no other arrays are allocated and that released arrays immediately stop contributing to this count.


A flowchart shows an append operation with a resizing branch when the array has no spare slot.


For each policy, find the total number of existing-reference copies caused by resizing and the peak allocated capacity in reference slots. Exclude writes of newly appended references from the copy counts. Enter exact integers.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More List ADT Questions: