Linked List Data Structure
In simple words, a linked list consists of nodes where each node contains a data field and a reference(link) to the next node in the list.
Advantages of Linked Lists
- They are a dynamic in nature which allocates the memory when required.
- Insertion and deletion operations can be easily implemented.
- Stacks and queues can be easily executed.
- Linked List reduces the access time.
Disadvantages of Linked Lists
- The memory is wasted as pointers require extra memory for storage.
- No element can be accessed randomly; it has to access each node sequentially.
- Reverse Traversing is difficult in linked list.
Applications of Linked Lists
- Linked lists are used to implement stacks, queues, graphs, etc.
- Linked lists let you insert elements at the beginning and end of the list.
- In Linked Lists we don't need to know the size in advance.
Types of Linked Lists
There are 3 different implementations of Linked List available, they are:- Singly Linked List
- Doubly Linked List
- Circular Linked List
Singly Linked List
Singly linked lists contain nodes which have a data part as well as an address part i.e.next
, which points to the next node in the sequence of nodes.The operations we can perform on singly linked lists are insertion, deletion and traversal.
No comments:
Post a Comment
Your feedback is highly appreciated and will help us to improve our content.