CircularArray
CircularArray is a generic circular array data structure that provides O(1) random read, O(1) prepend and O(1) append. The CircularArray automatically grows its capacity when number of added items is over its capacity.
Parameters
the minimum capacity, between 1 and 2^30 inclusive
Constructors
Creates a circular array with capacity for at least minCapacity elements.
Functions
Add an element in front of the CircularArray.
Remove all elements from the CircularArray.
Get nth (0 <= n <= size()-1) element of the CircularArray.
Remove first element from front of the CircularArray and return it.
Remove last element from end of the CircularArray and return it.
Remove multiple elements from end of the CircularArray, ignore when count is less than or equals to 0.
Remove multiple elements from front of the CircularArray, ignore when count is less than or equal to 0.
Get number of elements in the CircularArray.