Please read the following requirements carefully and then implement your own customized Array class:
provide the following features:
Two constructors. One takes the input of the initialized capacity (int) and create the underlying array with that capacity; the other takes no input and creates an array that can hold a single element by default (that is, init capacity == 1);
Getters and setters and basic methods we discussed during the class including: getCapacity(), getSize(), set(int index), get(int index), isEmpty();
CRUD operations we discussed during the class including: add(int index), addLast(), addFirst(), remove(int index), removeLast(), removeFirst(), removeElement(int target), removeAll(int target);
Supports generic types;
Mutable, that is when add element exceeding its capacity, it can resize to accommodate the change.
Implement a (private or public) swap(int a, int b) method that swaps the two elements in the index a and b if a and b are both admissible; also a public reverse() method that reverses the order of stored elements in-place (means, no additional spaces are allocated).
A public void sort() method sorts the stored elements in ascending order inO(nlog(n)) time.
[hint]: Quicksort or Merge sort
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.