Linked list is a data structure which consists of different nodes connected with each other through a pointer.
Node consists of 2 parts:
First part is the data part and the second part is the reference part which points to the next node.
Linked lists are used to implement other data structures like stacks, queues, arrays etc.
Structure definition for node
Structure implementation for node
Class definition for linked list
Class implementation for linked list
How to insert a new node to the end of linked list
For inserting a new node to the end of the linked list, read:
How to insert a new node to the start of linked list
For inserting a new node to the start of the linked list, read: