Menu

Would Go Writing Bodies Insert Deleteat Methods Q43888787

/** * This class provides a growable array for primitive long values * @author * @version 1.0 1/16/2020 */ class BigIntArrayL

How would we go about writing the bodies of the insert anddeleteAt methods?

/** * This class provides a growable array for primitive long values * @author * @version 1.0 1/16/2020 */ class BigIntArrayList { //fields private long[] list; private int count; * Constructor. Initializes the underlying array to 10 elements. BigIntArrayList() { list = new long[10]; count = 0; * Inserts the given long value at the given index. The index is * assumed to be a value between 0 and count. Existing elements * are moved up as needed to make room for the new value. * @param index the index where the new value should be stored * @param value the value to be stored */ public void insert (int index, long value) { * Deletes the value at the given index. The index is * assumed to be a value between 0 and count – 1. Existing elements * are moved down as needed to keep all values contiguous, without * any empty spaces in the array. * @param index the index of the element that should be removed * @return the value that was removed public long deleteAt (int index) { return 0; Show transcribed image text /** * This class provides a growable array for primitive long values * @author * @version 1.0 1/16/2020 */ class BigIntArrayList { //fields private long[] list; private int count; * Constructor. Initializes the underlying array to 10 elements. BigIntArrayList() { list = new long[10]; count = 0; * Inserts the given long value at the given index. The index is * assumed to be a value between 0 and count. Existing elements * are moved up as needed to make room for the new value. * @param index the index where the new value should be stored * @param value the value to be stored */ public void insert (int index, long value) { * Deletes the value at the given index. The index is * assumed to be a value between 0 and count – 1. Existing elements * are moved down as needed to keep all values contiguous, without * any empty spaces in the array. * @param index the index of the element that should be removed * @return the value that was removed public long deleteAt (int index) { return 0;

Expert Answer


Answer to How would we go about writing the bodies of the insert and deleteAt methods?…

OR