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.
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With