The linked list is a basic data structure. it's an abstract data type that stores data into a noncontinuous memory location. and made up of nodes.

in the array, we have the data arranged in a sequential and continuous memory location. as you see in the image given below.



so all the nodes are connected together in a form to represent the linear order of the list.
Info part of the linked list contains the actual value and the link part store the reference to the next value of the linked list.

Here is an example of a linked list that contains six nodes. and all the values of the linked list are connected using the link of every node.
Note: the first node contains the value of the first node and reference to the second node. as well as the second node containing the value of the second node and reference of the third value and soon.
we only need to remember and store the reference of the first node. using the reference of the first node we can traverse the whole list and can access all the elements of the list.
Insertion and deletion of elements are easier and they can be used to implement the abstract data types like lists, stacks, and queues.
to implement the linked list, we need extra memory. and this extra memory is used to store the links of every node.

After completing this tutorial you will be able to learn
- What is a Linked list?
- The node of the linked list
- Example of a linked list
- Advantages of linked list
- Disadvantages of linked list
in the array, we have the data arranged in a sequential and continuous memory location. as you see in the image given below.

What is Linked List?
In the linked list data is not arranged in sequential order. as you see in the image given below. but with each item, a reference to the next item is stored in a memory location. so all the data is connected together with the help of links.
The node of the linked list
A node is a basic building block of the linked list. the list item together with the link is called a node of the linked list.
so all the nodes are connected together in a form to represent the linear order of the list.
Info part of the linked list contains the actual value and the link part store the reference to the next value of the linked list.

Here is an example of a linked list that contains six nodes. and all the values of the linked list are connected using the link of every node.
Note: the first node contains the value of the first node and reference to the second node. as well as the second node containing the value of the second node and reference of the third value and soon.
we only need to remember and store the reference of the first node. using the reference of the first node we can traverse the whole list and can access all the elements of the list.
Start variable
to implement a linked list we only store the reference to the first node using the start variable.The advantage of the linked list
linked list is a dynamic data structure.
it means we don't need to give the size of the linked list at the compile time of the program. we can give the size at the running time of the program. and also we can increase and decrease the size at the run time.
Data in a linked list is not stored in a contiguous memory location.
we don't need a contiguous memory to store the data of the linked list. it chooses randomly from the blank memory space to store the data.Insertion and deletion of elements are easier and they can be used to implement the abstract data types like lists, stacks, and queues.
The disadvantage of the linked list
we cannot access the data of the linked list in a random manner. like we need to traverse the whole list if we need to access the last element of the linked list.to implement the linked list, we need extra memory. and this extra memory is used to store the links of every node.
Types of linked list
- single linked list
- double linked list
- circular linked list
- linked lists with header node
- sorted linked list
Also, read other tutorials as well
- What are Data Structures and algorithms
- Algorithm design and analysis
- Classification of algorithms
- How to calculate the running time of an algorithm.
- Worst Average and Best-case analysis of the algorithm.
- Big o notation
- Big o notation examples
- Traversing in Linked list
- Operations on the linked list
- Insertion in the linked list
- Deletion in a linked list
- Reversing a linked list
- Sorting a linked list
- Find and remove the loop in the linked list
- Doubly linked list
- Insertion in the doubly linked list
- Deletion in the doubly linked list
- Reversing a doubly linked list
- Circular linked list
- Insertion in the circular linked list
- Deletion in the circular linked list
- Merge two linked list
- Header linked list
- Sorted linked list
- Stack in data structures
- Queue in data structures
- Circular queue
- Dequeue in the data structure
- Priority queue
- Polish notation
- Tree in the data structure
- Binary tree
- Array representation of the binary tree
- linked representation of a binary tree
- Traversing in the binary tree
- Inorder traversal in the binary tree
- Preorder traversal in the binary tree
- Postorder traversal in the binary tree
- Level order traversal in the binary tree
- Binary search tree
- Insertion in the binary search tree
- Deletion in the binary search tree
- Heap in data structures
0 Comments