Movement costs in an editing buffer

An editing program stores nine command identifiers in a dynamic array of capacity 16, using zero-based indexing. It first inserts a new identifier at index 3, preserving order, and then removes the identifier at index 6 of the resulting sequence, again preserving order. Capacity does not change.


Count one element write for each assignment that moves an existing identifier or stores the newly inserted identifier. Ignore reads, size updates, and clearing unused slots. Find the insertion's element writes, the removal's element writes, and the final size in elements. Give all three answers as integers, to zero decimal places.

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 Dynamic Arrays Questions: