Linked List

  • Doubly Linked List: The limitation of a Singly linked list is that it can only traverse the nest links and there is no corresponding way to traverse previous links. A doubly linked list provides capability to traverse forward as well as forward through the list. I doubly linked list a node includes three data fields: info, next and previous. Each node in a doubly linked list contains a reference (or link) to both the next and previous elements. If the current node is A then A.next points to its successor in the linked list, and A.previous points to its predecessor. First node previous points to null and last node next points to null.doubly Linked List
  • Java implementation of Doubly Linked List

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

    Create DoublyLinkList class which will hold nodes.

    All the methods are similar to singly link list only difference is that you have to change two links next and previous. Please refer previous page for details.

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

    • kundan dwivedi

      Nice Write up Kunal…keep it up