Horje
Linked List Data Structure

A linked list is a fundamental data structure in computer science. It mainly allows efficient insertion and deletion operations compared to arrays. Like arrays, it is also used to implement other data structures like stack, queue and deque.

What is a Linked List?

A linked list is a linear data structure that consists of a series of nodes connected by pointers (in C or C++) or references (in Java, Python and JavaScript). Each node contains data and a pointer/reference to the next node in the list. Unlike arrays, linked lists allow for efficient insertion or removal of elements from any position in the list, as the nodes are not stored contiguously in memory.

Linked Lists vs Arrays

Here’s the comparison of Linked List vs Arrays

Linked List:

  • Data Structure: Non-contiguous
  • Memory Allocation: Typically allocated one by one to individual elements
  • Insertion/Deletion: Efficient
  • Access: Sequential

Array:

  • Data Structure: Contiguous
  • Memory Allocation: Typically allocated to the whole array
  • Insertion/Deletion: Inefficient
  • Access: Random

Types of Linked List

  1. Singly Linked List
  2. Doubly Linked List
  3. Circular Linked List
  4. Circular Doubly Linked List
  5. Header Linked List

Operations of Linked Lists:

Linked List Applications

  • Implementing stacks and queues using linked lists.
  • Using linked lists to handle collisions in hash tables.
  • Representing graphs using linked lists.
  • Allocating and deallocating memory dynamically.

Basics of Linked List:

Easy Problems on Linked List:

Medium Problems on Linked List:

Hard Problems on Linked List:

Quick Links :

Recommended:




Reffered: https://www.geeksforgeeks.org


DSA

Related
Print maximum number of ‘A’ using given four keys Print maximum number of ‘A’ using given four keys
Longest Palindromic Subsequence in Python Longest Palindromic Subsequence in Python
Double Hashing in Python Double Hashing in Python
Count-Min Sketch in Python Count-Min Sketch in Python
LMNs-Data Structures LMNs-Data Structures

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
16