Linked Lists are the data structures that can be used in place of the array. Here is the implementation of Linked List in C++ Programming Language.
It is a linear collection of data elements whose order is not given by their physical placement in memory. Here each part is called node which contains the data and a pointer that points to the next node. The storage of the linked list is in Heap section of the memory as we are using the "new" keyword.
There are 3 types of Linked list:
. Singly-linked list
. Doubly-linked list
. Circular Linked List
Here we are implementing Singly-Linked list in C++ Programming Language. We are using the concept of Class here to make a user-defined datatype which is called a node or LinkedListNode(here).
We can insert the element in a Linked list in 3 ways:
1) At the beginning
2) At the ending
3) At a specified index in the linked list.
All the 3 ways are explained here.
Submitted by Bharti Suraj Ramashanker (suraj1234)
Download packets of source code on Coders Packet