Linked List

Linked List is linear data structure where elements are store in contiguous location mean like array linked list elements are stored in one location. The element of linked list is known as node.

A node can have following two information.

  1. Data
  2. Address

Data part of node is used to keep the information like name,age,dob etc. Where as Address part stores memory addresss of next node so that they are connect to each other.

Advantages

  1. Dynamic :- The size of linked list is dynamic which means can be increased at run time.
  2. Insertion/Deletion :- Insertion and Deletion in linked is much faster than array because in array there are lots shifting operation need to perform for this.
  3. Merging:- Merging two linked list is much faster than merging two arrays as we need to create new array with size(total of both array size) and need to store and each and every element in that array. But in linked list only need to manage address only.

Disadvantages

  1. Random Access : Linked list doesn’t allow random access means you need to go one by one element. But in array we can get element using random access as in array all elements are in a single location. Only address need to be calculated using index and base address.
  2. Extra Memory Space : Linked list need extra memory space for their pointers but there are no need of extra space in array.

Types of Linked List

  1. Singly Linked List
  2. Doubly Linked List
  3. Circular Linked List

Leave a Reply