With the array-based implementation of the bag, how is the gap left when an item is removed
Fantastic news! We've Found the answer you've been seeking!
Question:
With the array-based implementation of the bag, how is the gap left when an item is removed handled?
1,The remove method was not implemented due to the difficult nature of the task.
2.The gap is filled with the last item in the array.
3.All items after the gap are moved up by one position.
4.The index of the gap is kept up with a free list to be used by the add method to fill the gaps.
Related Book For
Operations Management Processes And Supply Chains
ISBN: 9781292409863
13th Global Edition
Authors: Lee Krajewski, Naresh Malhotra, Larry Ritzman
Posted Date: