Doubly Linked list vs Multi-linked list in C/C++

18,886

Definition:

A multi linked list is a linked list where each node may contain pointers to more than one nodes of the linked list.

Doubly linked lists are a special case of Multi-linked lists. It is special in two ways:

  1. Each node has just 2 pointers.

  2. The pointers are exact inverses of each other.

Example:

A multi linked list:

enter image description here

A doubly linked list:

enter image description here

Representation:

Multi linked list:

typedef struct node
{
    int data;
    vector<struct node *> pointers;
}Node;

Doubly linked list:

typedef struct node
{
    int data;
    struct node* prev;
    struct node* next;
}Node;
Share:
18,886
Arun
Author by

Arun

Updated on June 05, 2022

Comments

  • Arun
    Arun almost 2 years

    What is the difference between doubly linked list and multi linked list? It will be better explaining me with the help of a C/C++ program.

  • irshad.ahmad
    irshad.ahmad about 10 years
    +1 for pictorial presentation