***Welcome to ashrafedu.blogspot.com * * * This website is maintained by ASHRAF***

    Friday, September 9, 2022

    Types of Linked Lists

    Linked list can be classified as

    1. Singly linked lists

    2. Doubly linked lists

    The other classification of linked lists based on their method of traversal is:

    1. Linear linked list

    2. Circular linked list

    Singly Linked List

    A linked list in which every node has one link fi eld, to provide information about where the next node of the list is, is called as singly linked list (SLL).

    In SLL, we can traverse only in one direction. SLL is just referred to as a linked list.

    Doubly Linked List

    In a doubly linked list (DLL), each node has two link fields to store information about the one to the next and also about the one ahead of the node. Each node has knowledge of its successor and also its predecessor. In DLL, from every node, the list can be traversed in both the directions.


     

    Both SSL and DLL may or may not contain a header node. The one with a header node is explicitly mentioned in the title as a header-SLL and a header-DLL.

    Linear Linked List

    All elements of linear linked list can be accessed by traversing a list from the first node of the list.

    Linear lists are also called non-circular or grounded lists.

    Circular Linked List

    In Circular linked list the link of the last node is pointed to the first node of the list. Any node in circular linked list can be reached from any other node in the list which is not possible in linear linked list.

    A circular list could be singly circular or doubly circular list and with or without a header node.


     

    No comments:

    Post a Comment

    Prim’s algorithm for finding MST (Minimum Spanning Tree)

    Prim's algorithm to find minimum cost spanning tree uses the greedy approach. Prim's algorithm, in contrast with Kruskal's algor...