ArrayList Generic
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Implement a generic Array.
Implement interface Arrayable<T>.
Implement class MyArray<T> based on ArrayList data structure that implements interface Arrayable<T>.
interface Arrayable<T> { void push_back(T x); // insert element to the end of array T pop_back(); // return and remove the last element T min(); // return minimum in array T max(); // return maximum in array T sum(); // return sum of elements in array. Implement for Integer, Long, Double boolean Empty(); // check if array is empty int size(); // return size of array } class MyArray<T extends Number & Comparable<T>> implements Arrayable<T> { ArrayList<T> m; ... }
Submissions 241
Acceptance rate 59%