- Singly linked list is the one way storing of the data elements.
- singly linked list provide only single directional operation.
- Single linked list provide only next address pointer,means we can not come back from any node,we can go always into forward direction.
- There is one HeadPointer which always points to the first node.HeadPointer have alot of benefits.
nextNode pointer of last node will always contain NULL.
Example :
Node Representation
- In Single Linked List ,Node is the collection of Data Element and Pointer variable for next Node.
- We can implement Node in C and C++ by the using of the structure User-define data type.
struct CreateNode
{
int DataElement; // for storing the DataElement
struct CreateNode* nextNode; // for pointing the next node.
}
Operations of Singly Linked List
There are following operations ,we can apply on singly linked list :
- Insertion of node at beginning(front) in SLL.
- Insertion of node at last(end) in SLL.
- Insertion of node at specific location in SLL.
- Deletion of node from beginning(front) in SLL.
- Deletion of node from last(end) in SLL.
- Deletion of node at Specific location in SLL.
- Searching of the Data in SLL.
Note : For Complete Explanation of Singly Linked List Operation ,please Refer above Link.
Application of SLL
- Can be use to implements the Stack and Queue Data Structure.
- Used to implement the Hash Map for preventing the data collision.
- Undo and Redo are implemented by SLL.