SIGLLY LINKED LIST

Reshma Mohandass

 SINGLY LINKED LIST

     A singlly linked list is a type of linked list that is unidirectional, that is, it can be traversed in only one direction from head to the last node (tail). 

      It is used to do a slideshow or some basic operations on a notepad like undo and redo.



You can create nodes of singly linked lists using classes or structures. And you link them using the next pointer.

USES OF SINGLY LINKED LIST:-

What Operations Can You Perform on a Singly Linked List?


You can perform two operations on a singly linked list:  

                 1. Insertion 

                 2. Deletion                                                                                                                                 How to Insert a Node in a Singly Linked List?


You can insert a node at three different positions, they are:

  • At the beginning
  • At the end
  • At a specific position after a node

 ADVANTAGES   :-  

  • You can perform operations like insertion and deletion with ease
  • It is a dynamic data structure, i.e., it does not have a fixed size
  • It doesn’t require the movement of nodes for insertion and deletion
  • It doesn’t need elements to be stored in consecutive memory spaces
  • It does not waste space as it uses space according to the recuirement. 

  DISADVANTAGES :-                

  • It requires more storage space because it also stores the next pointer with data
  • If you have to reach any node, then you have to go through every node before it
  • You can not traverse it from anywhere but the head node
  • It requires a different amount of time to access any elements
  • Sorting is complex in this linked list. 
Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send