Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • DSA
  • Interview Problems on Heap
  • Practice Heap
  • MCQs on Heap
  • Heap Tutorial
  • Binary Heap
  • Building Heap
  • Binomial Heap
  • Fibonacci Heap
  • Heap Sort
  • Heap vs Tree
  • Leftist Heap
  • K-ary Heap
  • Advantages & Disadvantages
Open In App
Next Article:
Advantages and Disadvantages of Heap
Next article icon

Binary Heap

Last Updated : 24 Mar, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report
Try it on GfG Practice
redirect icon

A Binary Heap is a complete binary tree that stores data efficiently, allowing quick access to the maximum or minimum element, depending on the type of heap. It can either be a Min Heap or a Max Heap. In a Min Heap, the key at the root must be the smallest among all the keys in the heap, and this property must hold true recursively for all nodes. Similarly, a Max Heap follows the same principle, but with the largest key at the root.

Valid and Invalid examples of heaps

How is Binary Heap represented? 

A Binary Heap is a Complete Binary Tree. A binary heap is typically represented as an array.

  • The root element will be at arr[0].
  • The below table shows indices of other nodes for the ith node, i.e., arr[i]:
arr[(i-1)/2]Returns the parent node
arr[(2*i)+1]Returns the left child node
arr[(2*i)+2]Returns the right child node

The traversal method use to achieve Array representation is Level Order Traversal. Please refer to Array Representation Of Binary Heap for details.

Representation-of-a-Binary-Heap
Representation of Binary Heap

Operations on Heap


Refer Introduction to Min-Heap – Data Structure and Algorithm Tutorials for more

C++
// A C++ program to demonstrate common Binary Heap Operations #include<iostream> #include<climits> using namespace std;  // Prototype of a utility function to swap two integers void swap(int *x, int *y);  // A class for Min Heap class MinHeap {     int *harr; // pointer to array of elements in heap     int capacity; // maximum possible size of min heap     int heap_size; // Current number of elements in min heap public:     // Constructor     MinHeap(int capacity);      // to heapify a subtree with the root at given index     void MinHeapify(int i);      int parent(int i) { return (i-1)/2; }      // to get index of left child of node at index i     int left(int i) { return (2*i + 1); }      // to get index of right child of node at index i     int right(int i) { return (2*i + 2); }      // to extract the root which is the minimum element     int extractMin();      // Decreases key value of key at index i to new_val     void decreaseKey(int i, int new_val);      // Returns the minimum key (key at root) from min heap     int getMin() { return harr[0]; }      // Deletes a key stored at index i     void deleteKey(int i);      // Inserts a new key 'k'     void insertKey(int k); };  // Constructor: Builds a heap from a given array a[] of given size MinHeap::MinHeap(int cap) {     heap_size = 0;     capacity = cap;     harr = new int[cap]; }  // Inserts a new key 'k' void MinHeap::insertKey(int k) {     if (heap_size == capacity)     {         cout << "\nOverflow: Could not insertKey\n";         return;     }      // First insert the new key at the end     heap_size++;     int i = heap_size - 1;     harr[i] = k;      // Fix the min heap property if it is violated     while (i != 0 && harr[parent(i)] > harr[i])     {        swap(&harr[i], &harr[parent(i)]);        i = parent(i);     } }  // Decreases value of key at index 'i' to new_val.  It is assumed that // new_val is smaller than harr[i]. void MinHeap::decreaseKey(int i, int new_val) {     harr[i] = new_val;     while (i != 0 && harr[parent(i)] > harr[i])     {        swap(&harr[i], &harr[parent(i)]);        i = parent(i);     } }  // Method to remove minimum element (or root) from min heap int MinHeap::extractMin() {     if (heap_size <= 0)         return INT_MAX;     if (heap_size == 1)     {         heap_size--;         return harr[0];     }      // Store the minimum value, and remove it from heap     int root = harr[0];     harr[0] = harr[heap_size-1];     heap_size--;     MinHeapify(0);      return root; }   // This function deletes key at index i. It first reduced value to minus // infinite, then calls extractMin() void MinHeap::deleteKey(int i) {     decreaseKey(i, INT_MIN);     extractMin(); }  // A recursive method to heapify a subtree with the root at given index // This method assumes that the subtrees are already heapified void MinHeap::MinHeapify(int i) {     int l = left(i);     int r = right(i);     int smallest = i;     if (l < heap_size && harr[l] < harr[i])         smallest = l;     if (r < heap_size && harr[r] < harr[smallest])         smallest = r;     if (smallest != i)     {         swap(&harr[i], &harr[smallest]);         MinHeapify(smallest);     } }  // A utility function to swap two elements void swap(int *x, int *y) {     int temp = *x;     *x = *y;     *y = temp; }  // Driver program to test above functions int main() {     MinHeap h(11);     h.insertKey(3);     h.insertKey(2);     h.deleteKey(1);     h.insertKey(15);     h.insertKey(5);     h.insertKey(4);     h.insertKey(45);     cout << h.extractMin() << " ";     cout << h.getMin() << " ";     h.decreaseKey(2, 1);     cout << h.getMin();     return 0; } 
Java
// Java program for the above approach import java.util.*;  // A class for Min Heap  class MinHeap {          // To store array of elements in heap     private int[] heapArray;          // max size of the heap     private int capacity;          // Current number of elements in the heap     private int current_heap_size;      // Constructor      public MinHeap(int n) {         capacity = n;         heapArray = new int[capacity];         current_heap_size = 0;     }          // Swapping using reference      private void swap(int[] arr, int a, int b) {         int temp = arr[a];         arr[a] = arr[b];         arr[b] = temp;     }               // Get the Parent index for the given index     private int parent(int key) {         return (key - 1) / 2;     }          // Get the Left Child index for the given index     private int left(int key) {         return 2 * key + 1;     }          // Get the Right Child index for the given index     private int right(int key) {         return 2 * key + 2;     }               // Inserts a new key     public boolean insertKey(int key) {         if (current_heap_size == capacity) {                          // heap is full             return false;         }              // First insert the new key at the end          int i = current_heap_size;         heapArray[i] = key;         current_heap_size++;                  // Fix the min heap property if it is violated          while (i != 0 && heapArray[i] < heapArray[parent(i)]) {             swap(heapArray, i, parent(i));             i = parent(i);         }         return true;     }          // Decreases value of given key to new_val.      // It is assumed that new_val is smaller      // than heapArray[key].      public void decreaseKey(int key, int new_val) {         heapArray[key] = new_val;          while (key != 0 && heapArray[key] < heapArray[parent(key)]) {             swap(heapArray, key, parent(key));             key = parent(key);         }     }          // Returns the minimum key (key at     // root) from min heap      public int getMin() {         return heapArray[0];     }               // Method to remove minimum element      // (or root) from min heap      public int extractMin() {         if (current_heap_size <= 0) {             return Integer.MAX_VALUE;         }          if (current_heap_size == 1) {             current_heap_size--;             return heapArray[0];         }                  // Store the minimum value,          // and remove it from heap          int root = heapArray[0];          heapArray[0] = heapArray[current_heap_size - 1];         current_heap_size--;         MinHeapify(0);          return root;     }              // This function deletes key at the      // given index. It first reduced value      // to minus infinite, then calls extractMin()     public void deleteKey(int key) {         decreaseKey(key, Integer.MIN_VALUE);         extractMin();     }          // A recursive method to heapify a subtree      // with the root at given index      // This method assumes that the subtrees     // are already heapified     private void MinHeapify(int key) {         int l = left(key);         int r = right(key);          int smallest = key;         if (l < current_heap_size && heapArray[l] < heapArray[smallest]) {             smallest = l;         }         if (r < current_heap_size && heapArray[r] < heapArray[smallest]) {             smallest = r;         }          if (smallest != key) {             swap(heapArray, key, smallest);             MinHeapify(smallest);         }     }          // Increases value of given key to new_val.     // It is assumed that new_val is greater      // than heapArray[key].      // Heapify from the given key     public void increaseKey(int key, int new_val) {         heapArray[key] = new_val;         MinHeapify(key);     }          // Changes value on a key     public void changeValueOnAKey(int key, int new_val) {         if (heapArray[key] == new_val) {             return;         }         if (heapArray[key] < new_val) {             increaseKey(key, new_val);         } else {             decreaseKey(key, new_val);         }     } }  // Driver Code class MinHeapTest {     public static void main(String[] args) {         MinHeap h = new MinHeap(11);         h.insertKey(3);         h.insertKey(2);         h.deleteKey(1);         h.insertKey(15);         h.insertKey(5);         h.insertKey(4);         h.insertKey(45);         System.out.print(h.extractMin() + " ");         System.out.print(h.getMin() + " ");                  h.decreaseKey(2, 1);         System.out.print(h.getMin());     } }  // This code is contributed by rishabmalhdijo 
Python
# A Python program to demonstrate common binary heap operations  # Import the heap functions from python library from heapq import heappush, heappop, heapify   # heappop - pop and return the smallest element from heap # heappush - push the value item onto the heap, maintaining #             heap invarient # heapify - transform list into heap, in place, in linear time  # A class for Min Heap class MinHeap:          # Constructor to initialize a heap     def __init__(self):         self.heap = []       def parent(self, i):         return (i-1)/2          # Inserts a new key 'k'     def insertKey(self, k):         heappush(self.heap, k)                 # Decrease value of key at index 'i' to new_val     # It is assumed that new_val is smaller than heap[i]     def decreaseKey(self, i, new_val):         self.heap[i]  = new_val          while(i != 0 and self.heap[self.parent(i)] > self.heap[i]):             # Swap heap[i] with heap[parent(i)]             self.heap[i] , self.heap[self.parent(i)] = (             self.heap[self.parent(i)], self.heap[i])                  # Method to remove minimum element from min heap     def extractMin(self):         return heappop(self.heap)      # This function deletes key at index i. It first reduces     # value to minus infinite and then calls extractMin()     def deleteKey(self, i):         self.decreaseKey(i, float("-inf"))         self.extractMin()      # Get the minimum element from the heap     def getMin(self):         return self.heap[0]  # Driver pgoratm to test above function heapObj = MinHeap() heapObj.insertKey(3) heapObj.insertKey(2) heapObj.deleteKey(1) heapObj.insertKey(15) heapObj.insertKey(5) heapObj.insertKey(4) heapObj.insertKey(45)  print heapObj.extractMin(), print heapObj.getMin(), heapObj.decreaseKey(2, 1) print heapObj.getMin()  # This code is contributed by Nikhil Kumar Singh(nickzuck_007) 
C#
// C# program to demonstrate common  // Binary Heap Operations - Min Heap using System;  // A class for Min Heap  class MinHeap{      // To store array of elements in heap public int[] heapArray{ get; set; }  // max size of the heap public int capacity{ get; set; }  // Current number of elements in the heap public int current_heap_size{ get; set; }  // Constructor  public MinHeap(int n) {     capacity = n;     heapArray = new int[capacity];     current_heap_size = 0; }  // Swapping using reference  public static void Swap<T>(ref T lhs, ref T rhs) {     T temp = lhs;     lhs = rhs;     rhs = temp; }  // Get the Parent index for the given index public int Parent(int key)  {     return (key - 1) / 2; }  // Get the Left Child index for the given index public int Left(int key) {     return 2 * key + 1; }  // Get the Right Child index for the given index public int Right(int key) {     return 2 * key + 2; }  // Inserts a new key public bool insertKey(int key) {     if (current_heap_size == capacity)     {                  // heap is full         return false;     }      // First insert the new key at the end      int i = current_heap_size;     heapArray[i] = key;     current_heap_size++;      // Fix the min heap property if it is violated      while (i != 0 && heapArray[i] <                       heapArray[Parent(i)])     {         Swap(ref heapArray[i],              ref heapArray[Parent(i)]);         i = Parent(i);     }     return true; }  // Decreases value of given key to new_val.  // It is assumed that new_val is smaller  // than heapArray[key].  public void decreaseKey(int key, int new_val) {     heapArray[key] = new_val;      while (key != 0 && heapArray[key] <                         heapArray[Parent(key)])     {         Swap(ref heapArray[key],               ref heapArray[Parent(key)]);         key = Parent(key);     } }  // Returns the minimum key (key at // root) from min heap  public int getMin() {     return heapArray[0]; }  // Method to remove minimum element  // (or root) from min heap  public int extractMin() {     if (current_heap_size <= 0)     {         return int.MaxValue;     }      if (current_heap_size == 1)     {         current_heap_size--;         return heapArray[0];     }      // Store the minimum value,      // and remove it from heap      int root = heapArray[0];      heapArray[0] = heapArray[current_heap_size - 1];     current_heap_size--;     MinHeapify(0);      return root; }  // This function deletes key at the  // given index. It first reduced value  // to minus infinite, then calls extractMin() public void deleteKey(int key) {     decreaseKey(key, int.MinValue);     extractMin(); }  // A recursive method to heapify a subtree  // with the root at given index  // This method assumes that the subtrees // are already heapified public void MinHeapify(int key) {     int l = Left(key);     int r = Right(key);      int smallest = key;     if (l < current_heap_size &&          heapArray[l] < heapArray[smallest])     {         smallest = l;     }     if (r < current_heap_size &&          heapArray[r] < heapArray[smallest])     {         smallest = r;     }          if (smallest != key)     {         Swap(ref heapArray[key],               ref heapArray[smallest]);         MinHeapify(smallest);     } }  // Increases value of given key to new_val. // It is assumed that new_val is greater  // than heapArray[key].  // Heapify from the given key public void increaseKey(int key, int new_val) {     heapArray[key] = new_val;     MinHeapify(key); }  // Changes value on a key public void changeValueOnAKey(int key, int new_val) {     if (heapArray[key] == new_val)     {         return;     }     if (heapArray[key] < new_val)     {         increaseKey(key, new_val);     } else     {         decreaseKey(key, new_val);     } } }  static class MinHeapTest{      // Driver code public static void Main(string[] args) {     MinHeap h = new MinHeap(11);     h.insertKey(3);     h.insertKey(2);     h.deleteKey(1);     h.insertKey(15);     h.insertKey(5);     h.insertKey(4);     h.insertKey(45);          Console.Write(h.extractMin() + " ");     Console.Write(h.getMin() + " ");          h.decreaseKey(2, 1);     Console.Write(h.getMin()); } }  // This code is contributed by  // Dinesh Clinton Albert(dineshclinton) 
JavaScript
// A class for Min Heap class MinHeap {     // Constructor: Builds a heap from a given array a[] of given size     constructor()     {         this.arr = [];     }      left(i) {         return 2*i + 1;     }      right(i) {         return 2*i + 2;     }      parent(i){         return Math.floor((i - 1)/2)     }          getMin()     {         return this.arr[0]     }          insert(k)     {         let arr = this.arr;         arr.push(k);              // Fix the min heap property if it is violated         let i = arr.length - 1;         while (i > 0 && arr[this.parent(i)] > arr[i])         {             let p = this.parent(i);             [arr[i], arr[p]] = [arr[p], arr[i]];             i = p;         }     }      // Decreases value of key at index 'i' to new_val.      // It is assumed that new_val is smaller than arr[i].     decreaseKey(i, new_val)     {         let arr = this.arr;         arr[i] = new_val;                  while (i !== 0 && arr[this.parent(i)] > arr[i])         {            let p = this.parent(i);            [arr[i], arr[p]] = [arr[p], arr[i]];            i = p;         }     }      // Method to remove minimum element (or root) from min heap     extractMin()     {         let arr = this.arr;         if (arr.length == 1) {             return arr.pop();         }                  // Store the minimum value, and remove it from heap         let res = arr[0];         arr[0] = arr[arr.length-1];         arr.pop();         this.MinHeapify(0);         return res;     }       // This function deletes key at index i. It first reduced value to minus     // infinite, then calls extractMin()     deleteKey(i)     {         this.decreaseKey(i, this.arr[0] - 1);         this.extractMin();     }      // A recursive method to heapify a subtree with the root at given index     // This method assumes that the subtrees are already heapified     MinHeapify(i)     {         let arr = this.arr;         let n = arr.length;         if (n === 1) {             return;         }         let l = this.left(i);         let r = this.right(i);         let smallest = i;         if (l < n && arr[l] < arr[i])             smallest = l;         if (r < n && arr[r] < arr[smallest])             smallest = r;         if (smallest !== i)         {             [arr[i], arr[smallest]] = [arr[smallest], arr[i]]             this.MinHeapify(smallest);         }     } }  let h = new MinHeap();     h.insert(3);      h.insert(2);     h.deleteKey(1);     h.insert(15);     h.insert(5);     h.insert(4);     h.insert(45);          console.log(h.extractMin() + " ");     console.log(h.getMin() + " ");          h.decreaseKey(2, 1);      console.log(h.extractMin()); 

Output
2 4 1 

Applications of Heaps

  • Heap Sort: Heap Sort uses Binary Heap to sort an array in O(nLogn) time.
  • Priority Queue: Priority queues can be efficiently implemented using Binary Heap because it supports insert(), delete() and extractmax(), decreaseKey() operations in O(log N) time. Binomial Heap and Fibonacci Heap are variations of Binary Heap. These variations perform union also efficiently.
  • Graph Algorithms: The priority queues are especially used in Graph Algorithms like Dijkstra's Shortest Path and Prim's Minimum Spanning Tree.
  • Many problems can be efficiently solved using Heaps.
    See following for example. a) K'th Largest Element in an array. b) Sort an almost sorted array/ c) Merge K Sorted Arrays.

Related Links:

  • Coding Practice on Heap 
  • All Articles on Heap 
  • Quiz on Heap 

Next Article
Advantages and Disadvantages of Heap

K

kartik
Improve
Article Tags :
  • Heap
  • DSA
Practice Tags :
  • Heap

Similar Reads

    Heap Data Structure
    A Heap is a complete binary tree data structure that satisfies the heap property: for every node, the value of its children is greater than or equal to its own value. Heaps are usually used to implement priority queues, where the smallest (or largest) element is always at the root of the tree.Basics
    2 min read
    Introduction to Heap - Data Structure and Algorithm Tutorials
    A Heap is a special tree-based data structure with the following properties:It is a complete binary tree (all levels are fully filled except possibly the last, which is filled from left to right).It satisfies either the max-heap property (every parent node is greater than or equal to its children) o
    15+ min read
    Binary Heap
    A Binary Heap is a complete binary tree that stores data efficiently, allowing quick access to the maximum or minimum element, depending on the type of heap. It can either be a Min Heap or a Max Heap. In a Min Heap, the key at the root must be the smallest among all the keys in the heap, and this pr
    13 min read
    Advantages and Disadvantages of Heap
    Advantages of Heap Data StructureTime Efficient: Heaps have an average time complexity of O(log n) for inserting and deleting elements, making them efficient for large datasets. We can convert any array to a heap in O(n) time. The most important thing is, we can get the min or max in O(1) timeSpace
    2 min read
    Time Complexity of building a heap
    Consider the following algorithm for building a Heap of an input array A. A quick look over the above implementation suggests that the running time is O(n * lg(n)) since each call to Heapify costs O(lg(n)) and Build-Heap makes O(n) such calls. This upper bound, though correct, is not asymptotically
    2 min read
    Applications of Heap Data Structure
    Heap Data Structure is generally taught with Heapsort. Heapsort algorithm has limited uses because Quicksort is better in practice. Nevertheless, the Heap data structure itself is enormously used. Priority Queues: Heaps are commonly used to implement priority queues, where elements with higher prior
    2 min read
    Comparison between Heap and Tree
    What is Heap? A Heap is a special Tree-based data structure in which the tree is a complete binary tree. Types of Heap Data Structure: Generally, Heaps can be of two types: Max-Heap: In a Max-Heap the key present at the root node must be greatest among the keys present at all of its children. The sa
    3 min read
    When building a Heap, is the structure of Heap unique?
    What is Heap? A heap is a tree based data structure where the tree is a complete binary tree that maintains the property that either the children of a node are less than itself (max heap) or the children are greater than the node (min heap). Properties of Heap: Structural Property: This property sta
    4 min read

    Some other type of Heap

    Binomial Heap
    The main application of Binary Heap is to implement a priority queue. Binomial Heap is an extension of Binary Heap that provides faster union or merge operation with other operations provided by Binary Heap. A Binomial Heap is a collection of Binomial Trees What is a Binomial Tree? A Binomial Tree o
    15 min read
    Fibonacci Heap | Set 1 (Introduction)
    INTRODUCTION:A Fibonacci heap is a data structure used for implementing priority queues. It is a type of heap data structure, but with several improvements over the traditional binary heap and binomial heap data structures.The key advantage of a Fibonacci heap over other heap data structures is its
    5 min read
    Leftist Tree / Leftist Heap
    INTRODUCTION:A leftist tree, also known as a leftist heap, is a type of binary heap data structure used for implementing priority queues. Like other heap data structures, it is a complete binary tree, meaning that all levels are fully filled except possibly the last level, which is filled from left
    15+ min read
    K-ary Heap
    Prerequisite - Binary Heap K-ary heaps are a generalization of binary heap(K=2) in which each node have K children instead of 2. Just like binary heap, it follows two properties: Nearly complete binary tree, with all levels having maximum number of nodes except the last, which is filled in left to r
    15 min read

    Easy problems on Heap

    Check if a given Binary Tree is a Heap
    Given a binary tree, check if it has heap property or not, Binary tree needs to fulfil the following two conditions for being a heap: It should be a complete tree (i.e. Every level of the tree, except possibly the last, is completely filled, and all nodes are as far left as possible.).Every node’s v
    15+ min read
    How to check if a given array represents a Binary Heap?
    Given an array, how to check if the given array represents a Binary Max-Heap.Examples: Input: arr[] = {90, 15, 10, 7, 12, 2} Output: True The given array represents below tree 90 / \ 15 10 / \ / 7 12 2 The tree follows max-heap property as every node is greater than all of its descendants. Input: ar
    11 min read
    Iterative HeapSort
    HeapSort is a comparison-based sorting technique where we first build Max Heap and then swap the root element with the last element (size times) and maintains the heap property each time to finally make it sorted. Examples: Input : 10 20 15 17 9 21 Output : 9 10 15 17 20 21 Input: 12 11 13 5 6 7 15
    11 min read
    Find k largest elements in an array
    Given an array arr[] and an integer k, the task is to find k largest elements in the given array. Elements in the output array should be in decreasing order.Examples:Input: [1, 23, 12, 9, 30, 2, 50], k = 3Output: [50, 30, 23]Input: [11, 5, 12, 9, 44, 17, 2], k = 2Output: [44, 17]Table of Content[Nai
    15+ min read
    K’th Smallest Element in Unsorted Array
    Given an array arr[] of N distinct elements and a number K, where K is smaller than the size of the array. Find the K'th smallest element in the given array. Examples:Input: arr[] = {7, 10, 4, 3, 20, 15}, K = 3 Output: 7Input: arr[] = {7, 10, 4, 3, 20, 15}, K = 4 Output: 10 Table of Content[Naive Ap
    15 min read
    Height of a complete binary tree (or Heap) with N nodes
    Consider a Binary Heap of size N. We need to find the height of it. Examples: Input : N = 6 Output : 2 () / \ () () / \ / () () () Input : N = 9 Output : 3 () / \ () () / \ / \ () () () () / \ () ()Recommended PracticeHeight of HeapTry It! Let the size of the heap be N and the height be h. If we tak
    3 min read
    Heap Sort for decreasing order using min heap
    Given an array of elements, sort the array in decreasing order using min heap. Examples: Input : arr[] = {5, 3, 10, 1}Output : arr[] = {10, 5, 3, 1}Input : arr[] = {1, 50, 100, 25}Output : arr[] = {100, 50, 25, 1}Prerequisite: Heap sort using min heap.Using Min Heap Implementation - O(n Log n) Time
    11 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences