What is the Singly Linked List (SLL)?
In this lesson, we will be introduced to the Singly Linked List and its structure, along with some basic operations that this data structure offers.
We'll cover the following
Introduction #
Linked Lists and Arrays are quite similar in characteristics as they are both used to store a collection of the same type of data. A data type can be anywhere from a simple primitive integer to a complex object of a particular class. However, the structure of the Linked List is very different as compared to Arrays.
Applications #
Some important applications of Linked Lists include:
- Implementing HashMaps, File System and Adjacency Lists
- Dynamic memory allocation: We use linked lists of free blocks
- Performing arithmetic operations on long integers
- Maintaining a directory of names
Structure of Linked List #
A linked list is formed by nodes that are linked together like a chain. Each node holds data, along with a pointer to the next node in the list. The Singly Linked List (SLL) is the type of linked list where each node has only one pointer that stores the reference to the next value. The following illustration shows a Singly Linked List.
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.