Memory representation of Linked List
In memory the linked list is stored in scattered cells (locations).The memory for each node is allocated dynamically means as and when required. So the Linked List can increase as per the user wish and the size is not fixed, it can vary.
Suppose first node of linked list is allocated with an address 1008. Its graphical representation looks like the figure shown below:
Suppose next node is allocated at an address 506, so the list becomes,
Suppose next node is allocated with an address with an address 10,s the list become,
The other way to represent the linked list is as shown below:
In the above representation the data stored in the linked list is “INDIA”, the information part of each node contains one character. The external pointer root points to first node’s address 1005. The link part of the node containing information I contains 1007, the address of next node. The last node of the list contains an address 0, the invalid address or NULL address.
Example:
In memory the linked list is stored in scattered cells (locations).The memory for each node is allocated dynamically means as and when required. So the Linked List can increase as per the user wish and the size is not fixed, it can vary.
Suppose first node of linked list is allocated with an address 1008. Its graphical representation looks like the figure shown below:
Suppose next node is allocated at an address 506, so the list becomes,
Suppose next node is allocated with an address with an address 10,s the list become,
The other way to represent the linked list is as shown below:
In the above representation the data stored in the linked list is “INDIA”, the information part of each node contains one character. The external pointer root points to first node’s address 1005. The link part of the node containing information I contains 1007, the address of next node. The last node of the list contains an address 0, the invalid address or NULL address.
Example:
The data stored in the linked list is: “The Is Another:
Q. What is stored in the Linked List shown below?