Advertisements
Advertisements
Question
How linked list are represented in Memory ?
Solution
(1) Linked lists can be represented in memory by using two arrays respectively known as INFO and LINK, such that INFO[K] and LINK[K] contains information of element and next node address respectively.
(2) The list also requires a variable ‘Name’ or ‘Start’, which contains address of first node. Pointer field of last node denoted by NULL which indicates the end of list. e.g., Consider a linked list given below :
(3) 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?