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:
Each node has just 2 pointers.
The pointers are exact inverses of each other.
Example:
A multi linked list:
A doubly linked list:
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;
Author by
Arun
Updated on June 05, 2022Comments
-
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 about 10 years+1 for pictorial presentation