Build Your Own CircularArrayList In Under 34 Minutes
.MP4, AVC, 1920x1080, 30 fps | English, AAC, 2 Ch | 34m | 3.03 GB
Instructor: Dr Heinz M. Kabutz
.MP4, AVC, 1920x1080, 30 fps | English, AAC, 2 Ch | 34m | 3.03 GB
Instructor: Dr Heinz M. Kabutz
See how we can create our own CircularArrayList by reusing the Collection framework abstract base classes.
In this mini-course, we learn how to build a CircularArrayList. Similar to a normal ArrayList, but with a head position that can change within the array. The normal ArrayList always has the head at position 0, making it inefficient to add or remove elements at the front. Since it is still based on an array, we have the benefit of constant time access. It is thus still a valid RandomAccess List implementation.