
504 Programming and Data Structures
a) Creation of node: Before insertion, the node is created. Using m alloc () function memory
space is booked for the node.
b) Assignment of data: Once the node is created, data values are assigned to members.
c) Adjusting pointers: The insertion operation changes the sequence. Hence, according to the
sequence, the address of the next element is assigned to the inserted node. The address of the
current node (inserted) is assigned to the previous node.
The node can be inserted in the following positions in the list.
a) Insertion of the node at the starting: The created node is inserted before the first