Circular Array
7.9 Circular Array: Implement a CircularArray
class that supports an array-like data structure which can be efficiently rotated. If possible, the class should use a generic type (also called a template), and should support iteration via the standard for (Obj 0 : circularArray) notation.
The Idea: Override/redefine the iterater methods, and maintain a counter that mods off the array size.
Complexity: O(1) retrival methods
Last updated