-->

Wednesday, February 26, 2014

Memory representation of Linked List Data Structures in C Language

 Memory representation of Linked List Data Structures in C Language

                                 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:

The data stored in the linked list is: “The Is Another:
 Example Of Linked List”

Q. What is stored in the linked list shown below?



Q. What is stored in the Linked List shown below?



Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved