Linked List

  • Circular Linked List: A Circular list form a ring. The list is finite and each node has a successor. In a Singly Circular list the last node points to the first node. In a Doubly Circular list the first node previous points to the last node and the last node next points to the first node.
    Singly Circular list
    circular Linked List
    Doubly Circular listdoubly circular linked list
  • Java implementation of Circular Linked List

    Create a Node class first which will keep info and link to the next element.

    Create CircularLinkList class which will hold nodes in a circular manner.

    All the methods are similar to singly link list only difference is that the last element will point to the first element which make difference in insert/delete at first and last position. Please refer previous page for details.
    The Doubly CircularLinkList is the combination of doubly link list and circular list. It is very easy to implement. I leave the implementation as a task for the reader.

    Go to the next page – Click on the below red circle with page number.

    • kundan dwivedi

      Nice Write up Kunal…keep it up