Circular linked lists

A circular linked list can have only one reference direction (as the linked list) or a double reference as the doubly linked list. The only difference between the circular linked list and a linked list is that the last element's next (tail.next) pointer does not make a reference to null, but to the first element (head), as we can see in the following diagram:

Circular linked lists

And a doubly circular linked list has tail.next pointing to the head element and head.prev pointing to the tail element:

Circular linked lists

Note

We don't have the scope to cover the CircularLinkedList algorithm in this book (the source code is very similar to LinkedList and DoublyLinkedList). However, you can access the code by downloading this book's source code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset