Linked-lists Basic

What is Linked lists?

Linked list is a very uses linear data stucture which consists of group of nodes in a sequence. Each node holds its own data and the address of the next node hence forming a chain like structure. Linked lists are used to create trees and graphs.

Advantages of linked lists

  • They are dynamic in nature which allocates 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 traverse is difficult in linked lists.

Application of linked lists

  • linked list are used to implement stacks, queues, graphs etc.
  • linked list let you to insert elements at the beginning and ending.
  • In linked list we don’t need to know the size in advance

Types of linked lists

  • Singly linked lists
  • Doubly linked lists
  • Circular linked lists Lets know more about them and how they are different from each other.

Singly linked lists

Singly linked lists contain nodes which have a data part as well as an address part which points the next node in the sequence of nodes. The operation we can perform on singly linked lists are insertion , deletion and traversal.

Doubly linked lists

Doubly linked lists contain each node has one data part and two address part, one part points to previous node address and other points to next node address.

Circular linked lists

Circular linked lists contain the last node holds first node’s address that’s why its called Circular linked lists.

Previous
Next