Question: Dynamic Arrays Java Implement a dynamic array for integers with a constructor that receives the initial capacity and a method to remove elements. When removing
Dynamic Arrays Java
Implement a dynamic array for integers with a constructor that receives the initial capacity and a method to remove elements. When removing the element at the position index, you must shift the elements after index by 1 to fill the empty space. All unallocated values must be 0 (including the one left free because of the shifting after a removal). If the size becomes less than half of the inner capacity, you must halve the inner capacity. Bonus: the remove(int index) method returns true if the removal terminated successfully, false if index is not a valid index of the dynamic array. Make the necessary comments.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
