[CC150v5] 14.6 Implement CircularArray in Java - Shuatiblog.com
Question
Implement a CircularArray class that supports an array-like data structure which can be efficiently rotated.
The class should use a generic type, and should support iteration via the standard for (Object : circuLarArray) notation.
Solution
First part of the question is solved by using an array and a pointer. The solution simplifies the question by fixing the array size (not a dynamic-resizing array).
The difficult part is how to write iterator.
Read full article from [CC150v5] 14.6 Implement CircularArray in Java - Shuatiblog.com
No comments:
Post a Comment