Linked List
Linked List is linear and dynamic data structure. The list is a collection of elements called nodes and each node is created dynamically. Linked List comes into picture to overcome the disadvantages of Array. In array it is not possible to vary the size. The size is fixed and the memory is allocated statically when it is declared. During the compilation time the memory is allocated to array. In case of linked list memory is allocated at the time of execution, so the size can vary according to the user wish. In case of Linked List only linear search is possible and it is difficult to apply sorting.
Each node in the linked list consists of two parts. One part is called as INFO(information) part and the other part is called LINK or NEXT (pointer to next node) part. The INFO part contains the information about the element which is same type for all the nodes and the link part contains address or location of the next element in the List. As one element is linked with the other element, so the list is called as Linked List. The address of the first node of the linked list is stored in an external pointer called ROOT or FIRST.
NODE
Graphical representation of Linked List
ROOT contains the address of the first node FIRST, FIRST node ‘s link field contains the address of the second node SECOND, SECOND node’s link filed contains the address of the third node THIRD and THIRD node’s link field contains the address of the fourth node FOURTH. Fourth node the last node’s link field of the list contains a NULL address to specify the end of the list. In this case NULL address is marked with X (cross). In some representations it is marked to point to ground symbol.
Linked List is linear and dynamic data structure. The list is a collection of elements called nodes and each node is created dynamically. Linked List comes into picture to overcome the disadvantages of Array. In array it is not possible to vary the size. The size is fixed and the memory is allocated statically when it is declared. During the compilation time the memory is allocated to array. In case of linked list memory is allocated at the time of execution, so the size can vary according to the user wish. In case of Linked List only linear search is possible and it is difficult to apply sorting.
Each node in the linked list consists of two parts. One part is called as INFO(information) part and the other part is called LINK or NEXT (pointer to next node) part. The INFO part contains the information about the element which is same type for all the nodes and the link part contains address or location of the next element in the List. As one element is linked with the other element, so the list is called as Linked List. The address of the first node of the linked list is stored in an external pointer called ROOT or FIRST.
NODE
Graphical representation of Linked List
ROOT contains the address of the first node FIRST, FIRST node ‘s link field contains the address of the second node SECOND, SECOND node’s link filed contains the address of the third node THIRD and THIRD node’s link field contains the address of the fourth node FOURTH. Fourth node the last node’s link field of the list contains a NULL address to specify the end of the list. In this case NULL address is marked with X (cross). In some representations it is marked to point to ground symbol.
- Memory representation of linked list
- Free Pool
- Linear Linked List Creation
- C Program to create unordered singly linked list
- Operation on Linked List
- Insertion in a unordered linked list
- Insertion in a ordered linked list
- Deletion
- C Program to create ordered singly linked list with 'insertion' operation that insert a node in the linked list.
- The complete C Prorgam to perform Insertion, Deletion, Searching and Traverse operation on ordered singly linked list