Open In App

Singly Linked List definition & meaning DSA

Last Updated : 22 Apr, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

A singly linked list is a special type of linked list in which each node has only one link that points to the next node in the linked list.

Singly linked list

Singly linked list

Characteristics of a Singly Linked List:

  • Each node holds a single value and a reference to the next node in the list.
  • The list has a head, which is a reference to the first node in the list, and a tail, which is a reference to the last node in the list.
  • The nodes are not stored in a contiguous block of memory, but instead, each node holds the address of the next node in the list.
  • Accessing elements in a singly linked list requires traversing the list from the head to the desired node, as there is no direct access to a specific node in memory.

Application of Singly Linked Lists:

  • Memory management: Singly linked lists can be used to implement memory pools, in which memory is allocated and deallocated as needed.
  • Database indexing: Singly linked lists can be used to implement linked lists in databases, allowing for fast insertion and deletion operations.
  • Representing polynomials and sparse matrices: Singly linked lists can be used to efficiently represent polynomials and sparse matrices, where most elements are zero.
  • Operating systems: Singly linked lists are used in operating systems for tasks such as scheduling processes and managing system resources.

Advantages of Singly Linked Lists:

  • Dynamic memory allocation: Singly linked lists allow for dynamic memory allocation, meaning that the size of the list can change at runtime as elements are added or removed.
  • Cache friendliness: Singly linked lists can be cache-friendly as nodes can be stored in separate cache lines, reducing cache misses and improving performance.
  • Space-efficient: Singly linked lists are space-efficient, as they only need to store a reference to the next node in each element, rather than a large block of contiguous memory.

Disadvantages of Singly Linked Lists:

  • Poor random access performance: Accessing an element in a singly linked list requires traversing the list from the head to the desired node, making it slow for random access operations compared to arrays.
  • Increased memory overhead: Singly linked lists require additional memory for storing the pointers to the next node in each element, resulting in increased memory overhead compared to arrays.
  • Vulnerability to data loss: Singly linked lists are vulnerable to data loss if a node’s next pointer is lost or corrupted, as there is no way to traverse the list and access other elements.
  • Not suitable for parallel processing: Singly linked lists are not suitable for parallel processing, as updating a node requires exclusive access to its next pointer, which cannot be easily done in a parallel environment.
  • Backward traversing not possible: In singly linked list does not support backward traversing. 

What else can you see?

  1. What is Linked List
  2. Introduction to Linked List – Data Structure and Algorithm Tutorials
  3. Applications, Advantages and Disadvantages of Linked List
  4. Types of Linked List

Similar Reads

Balanced Binary Tree definition & meaning in DSA
Balanced binary tree is defined as a binary tree data structure where there is no more than one height difference between the left and right subtrees of any given node. Mathematically Height of left subtree - Height of right subtree ≤1 [caption width="800"]Balanced and Unbalanced Binary Tree[/caption]Properties of Balanced Binary Tree: A balanced b
2 min read
Adjacency List meaning & definition in DSA
An adjacency list is a data structure used to represent a graph where each node in the graph stores a list of its neighboring vertices. [caption width="800"]Graph representation of Directed Graph to Adjacency List[/caption] Characteristics of the Adjacency List:The size of the matrix is determined by the number of nodes in the network.The number of
2 min read
Difference between Singly linked list and Doubly linked list
Introduction to Singly linked list : A singly linked list is a set of nodes where each node has two fields 'data' and 'link'. The 'data' field stores actual piece of information and 'link' field is used to point to next node. Basically the 'link' field stores the address of the next node. Introduction to Doubly linked list : A Doubly Linked List (D
2 min read
Convert Singly Linked List to XOR Linked List
Prerequisite: XOR Linked List – A Memory Efficient Doubly Linked List | Set 1XOR Linked List – A Memory Efficient Doubly Linked List | Set 2 An XOR linked list is a memory efficient doubly linked list in which the next pointer of every node stores the XOR of previous and next node's address. Given a singly linked list, the task is to convert the gi
9 min read
When is Doubly Linked List more Efficient than Singly Linked List?
Did you know there are some cases where a Doubly Linked List is more efficient than a Singly Linked List, even though it takes more memory compared to a Singly Linked List? What are those Cases? Well, we will discuss that in the following article, But first, let's talk about Singly and linked lists: What is a Singly Linked List?A singly linked list
4 min read
Convert singly linked list into circular linked list
Given a singly linked list, we have to convert it into circular linked list. For example, we have been given a singly linked list with four nodes and we want to convert this singly linked list into circular linked list. Approach: The idea is to traverse the singly linked list and check if the node is the last node or not. If the node is the last no
14 min read
Disjoint Set meaning and definition in DSA
Disjoint Set is a data structure that keeps track of a set of elements partitioned into a number of disjoint subsets and it is used to efficiently solve problems that involve grouping elements into sets and performing operations on them. Characteristics of the Disjoint Set:It keeps a set partitioned into disjoint subsets.It allows the efficient uni
2 min read
Array Definition & Meaning in DSA
An array is a collection of items of same data type stored at contiguous memory locations [caption width="800"]Array example[/caption]Types of Arrays:One-dimensional Array: It is the simplest kind of array where all the elements are stored linearly in a single row. Two-dimensional Array: A two-dimensional array is an array with 2 dimensions, i.e.,
4 min read
Stack Definition & Meaning in DSA
A stack is defined as a linear data structure that is open at one end and the operations follow the Last-In-First-Out (LIFO) order. [caption width="800"]Example of Stack[/caption]Characteristics of Stack:The stack follows the LIFO order, which means that the last element added to the stack will be the first element to be removed.A register that poi
2 min read
What is Tree | Tree Definition & Meaning in DSA
A tree is defined as a hierarchical data structure in which the elements (known as nodes) are linked together via edges such that there is only one path between any two node of the tree. [caption width="800"]Tree Data Structure[/caption]Properties of Trees:Number of edges: An edge can be defined as the connection between two nodes. If a tree has N
4 min read
Practice Tags :