Circular linked lists

In a singly or doubly linked list, there is no node after the last node, so the last node does not have any subsequent node to iterate on. If we allow the last node to point to the first node, we are making a circle. Such linked lists are known as circular linked lists. We can have both singly and doubly linked lists as circular linked lists. We will also implement a circular linked list in this chapter. The following image depicts a circular linked list:

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

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