Advertisements
Advertisements
Questions
How linked list are represented in Memory?
How linked list represent in memory.
Explain memory representation of linked list with a suitable example.
Explain
Long Answer
Advertisements
Solution
- A linked list can be stored in memory using two arrays called INFO and LINK, where INFO[K] stores the data of the node and LINK[K] stores the address of the next node.
- The list also needs a variable named START (or NAME) that holds the address of the first node. The pointer field of the last node contains NULL, indicating the end of the list. For example, consider the linked list shown below:

- The linked list can be represented in memory as:

Above figure shows linked list. It indicates that the node of a list need not occupy adjacent elements in the array INFO and LINK.
shaalaa.com
Basic Data Structures (Stack, Queue, Dequeue)
Is there an error in this question or solution?
