Linked List
Posted on 2021-04-12
What are Linked Lists?
- A sequential list of nodes that hold data which point to other nodes also containing data
- Similar to an array, but unlike arrays, elements are not stored in a particular memory location or index, rather each element is a separate object that contains a pointer or a link to the next object in that list
- Nodes can easily be removed or added from a linked list without reorganizing the entire data structure. This is one advantage it has over arrays.
- 3 types: Singly linked list, Doubly linked list and Circular linked list (a variation of a linked list in which the last node points to the first node or any other node before it, thereby forming a loop)
- Similar to an array, but unlike arrays, elements are not stored in a particular memory location or index, rather each element is a separate object that contains a pointer or a link to the next object in that list
- Nodes can easily be removed or added from a linked list without reorganizing the entire data structure. This is one advantage it has over arrays.
- 3 types: Singly linked list, Doubly linked list and Circular linked list (a variation of a linked list in which the last node points to the first node or any other node before it, thereby forming a loop)
Algorithm