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 Tree
  • Practice Tree
  • MCQs on Tree
  • Tutorial on Tree
  • Types of Trees
  • Basic operations
  • Tree Traversal
  • Binary Tree
  • Complete Binary Tree
  • Ternary Tree
  • Binary Search Tree
  • Red-Black Tree
  • AVL Tree
  • Full Binary Tree
  • B-Tree
  • Advantages & Disadvantages
Open In App
Next Article:
Segment Tree | Range Minimum Query
Next article icon

Segment Tree | Range Minimum Query

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

We have introduced a segment tree with a simple example in the previous post. In this post, the Range Minimum Query problem is discussed as another example where a Segment Tree can be used. The following is the problem statement:
We have an array arr[0 . . . n-1]. We should be able to efficiently find the minimum value from index qs (query start) to qe (query end) where 0 <= qs <= qe <= n-1. 
 
A simple solution is to run a loop from qs to qe and find the minimum element in the given range. This solution takes O(n) time in the worst case. 
Another solution is to create a 2D array where an entry [i, j] stores the minimum value in range arr[i..j]. The minimum of a given range can now be calculated in O(1) time, but preprocessing takes O(n2) time. Also, this approach needs O(n2) extra space which may become huge for large input arrays.
Segment tree can be used to do preprocessing and query in moderate time. With a segment tree, preprocessing time is O(n) and the time complexity for a range minimum query is O(log n). The extra space required is O(n) to store the segment tree.

Representation of Segment trees 

1. Leaf Nodes are the elements of the input array. 
2. Each internal node represents minimum of all leaves under it.
An array representation of tree is used to represent Segment Trees. For each node at index i, the left child is at index (2 * i + 1), right child at (2 * i + 2) and the parent is at (i - 1) / 2

Construction of Segment Tree from given array 

We start with a segment arr[0 . . . n-1]. and every time we divide the current segment into two halves (if it has not yet become a segment of length 1), and then call the same procedure on both halves, and for each such segment, we store the minimum value in a segment tree node. 

All levels of the constructed segment tree will be completely filled except the last level. Also, the tree will be a Full Binary Tree because we always divide segments in two halves at every level. Since the constructed tree is always full binary tree with n leaves, there will be n - 1 internal nodes. So total number of nodes will be 2 * n - 1. 
Height of the segment tree will be ?log?n?. Since the tree is represented using array and relation between parent and child indexes must be maintained, size of memory allocated for segment tree will be  2 * 2?log2n?  - 1. 

Query for minimum value of given range 

Once the tree is constructed, how to do range minimum query using the constructed segment tree. Following is algorithm to get the minimum. 

// qs--> query start index, qe --> query end index
int RMQ(node, qs, qe) {
if range of node is within qs and qe
return value in node
else if range of node is completely outside qsand qe
return INFINITE
else
return min ( RMQ(node's left child, qs, qe), RMQ (node's right child, qs, qe) )
}

C++
// C++ program for range minimum // query using segment tree  #include <bits/stdc++.h> using namespace std;  // A utility function to get minimum of two numbers  int minVal(int x, int y) {      return (x < y)? x: y;  }   // A utility function to get the  // middle index from corner indexes.  int getMid(int s, int e) {      return s + (e -s)/2;  }   // A recursive function to get the // minimum value in a given range of array // st --> Pointer to segment tree  // index --> Index of current node in the tree // ss & se --> Starting and ending indexes  // qs & qe --> Starting and ending indexes of query range int RMQUtil(vector<int> &st, int ss, int se, int qs,                                  int qe, int index) {       // If segment of this node is a part of given range     // then return the min of the segment     if (qs <= ss && qe >= se)          return st[index];       // If segment of this node if outside the range     if (se < qs || ss > qe)          return INT_MAX;       // If a part of this segment     // overlaps with the given range      int mid = getMid(ss, se);      return minVal(RMQUtil(st, ss, mid, qs, qe, 2*index+1),                  RMQUtil(st, mid+1, se, qs, qe, 2*index+2));  }   // Return minimum of elements in range // from index qs to qe int RMQ(vector<int> &st, int n, int qs, int qe) {       // Check for invalid input     if (qs < 0 || qe > n-1 || qs > qe) {          cout<<"Invalid Input";          return -1;      }      return RMQUtil(st, 0, n-1, qs, qe, 0);  }   // A recursive function that constructs // Segment Tree for array[ss..se].  int constructSTUtil(vector<int> &arr, int ss, int se,                             vector<int> &st, int si) {      // If there is one element in array,     // store it in current node of      // segment tree and return      if (ss == se) {          st[si] = arr[ss];          return arr[ss];      }       // If there are more than one elements,      // then recur for left and right subtrees      // and store the minimum of two values in this node      int mid = getMid(ss, se);      st[si] = minVal(constructSTUtil(arr, ss, mid, st, si*2+1),                      constructSTUtil(arr, mid+1, se, st, si*2+2));      return st[si];  }   // Function to construct segment tree  vector<int> constructST(vector<int> &arr, int n) {       //Height of segment tree      int x = (int)(ceil(log2(n)));       // Maximum size of segment tree      int max_size = 2*(int)pow(2, x) - 1;       vector<int> st(max_size);      // Fill the allocated memory st      constructSTUtil(arr, 0, n-1, st, 0);       // Return the constructed segment tree      return st;  }   int main() {       vector<int> arr = {1, 3, 2, 7, 9, 11};      int n = arr.size();      // Build segment tree from given array      vector<int> st = constructST(arr, n);       // Starting index of query range      int qs = 1;           // Ending index of query range      int qe = 5;       // Print minimum value in arr[qs..qe]      cout<<"Minimum of values in range ["<<qs<<", "<<qe<<"] "<<     "is = "<<RMQ(st, n, qs, qe)<<endl;       return 0;  } 
C
// C program for range minimum query  // using segment tree #include <stdio.h> #include <math.h> #include <limits.h> #include <stdlib.h>  // A utility function to get minimum of two numbers  int minVal(int x, int y) {      return (x < y)? x: y;  }   // A utility function to get the  // middle index from corner indexes.  int getMid(int s, int e) {      return s + (e -s)/2;  }   // A recursive function to get the // minimum value in a given range of array // st --> Pointer to segment tree  // index --> Index of current node in the tree // ss & se --> Starting and ending indexes  // qs & qe --> Starting and ending indexes of query range int RMQUtil(int *st, int ss, int se,              int qs, int qe, int index) {      // If segment of this node is a part of given range     // then return the min of the segment     if (qs <= ss && qe >= se)          return st[index];       // If segment of this node if outside the range     if (se < qs || ss > qe)          return INT_MAX;       // If a part of this segment     // overlaps with the given range      int mid = getMid(ss, se);      return minVal(RMQUtil(st, ss, mid, qs, qe, 2*index+1),                  RMQUtil(st, mid+1, se, qs, qe, 2*index+2)); }  // Return minimum of elements in range // from index qs to qe int RMQ(int *st, int n, int qs, int qe) {      // Check for erroneous input values     if (qs < 0 || qe > n-1 || qs > qe) {         printf("Invalid Input");         return -1;     }      return RMQUtil(st, 0, n-1, qs, qe, 0); }  // A recursive function that constructs // Segment Tree for array[ss..se].  int constructSTUtil(int arr[], int ss, int se,                              int *st, int si) {      // If there is one element in array,     // store it in current node of      // segment tree and return      if (ss == se) {          st[si] = arr[ss];          return arr[ss];      }       // If there are more than one elements,      // then recur for left and right subtrees      // and store the minimum of two values in this node      int mid = getMid(ss, se);      st[si] = minVal(constructSTUtil(arr, ss, mid, st, si*2+1),                      constructSTUtil(arr, mid+1, se, st, si*2+2));      return st[si];  }  // Function to construct segment tree int *constructST(int arr[], int n) {      //Height of segment tree     int x = (int)(ceil(log2(n)));       // Maximum size of segment tree     int max_size = 2*(int)pow(2, x) - 1;       int *st = (int*)malloc(max_size * sizeof(int));      // Fill the allocated memory st     constructSTUtil(arr, 0, n-1, st, 0);      // Return the constructed segment tree     return st; }  int main() {     int arr[] = {1, 3, 2, 7, 9, 11};     int n = sizeof(arr)/sizeof(arr[0]);      // Build segment tree from given array     int *st = constructST(arr, n);      // Starting index of query range     int qs = 1;        // Ending index of query range     int qe = 5;        // Print minimum value in arr[qs..qe]     printf("Minimum of values in range [%d, %d] is = %d\n",                            qs, qe, RMQ(st, n, qs, qe));      return 0; } 
Java
// Java program for range minimum  // query using segment tree  import java.util.*;  class GFG {      // A utility function to get minimum of two numbers     static int minVal(int x, int y) {         return (x < y) ? x : y;     }      // A utility function to get the      // middle index from corner indexes.     static int getMid(int s, int e) {         return s + (e - s) / 2;     }      // A recursive function to get the     // minimum value in a given range of array     static int RMQUtil(int[] st, int ss, int se,                          int qs, int qe, int index) {          // If segment of this node is a part of given range         // then return the min of the segment         if (qs <= ss && qe >= se)             return st[index];          // If segment of this node is outside the range         if (se < qs || ss > qe)             return Integer.MAX_VALUE;          // If a part of this segment         // overlaps with the given range         int mid = getMid(ss, se);         return minVal(RMQUtil(st, ss, mid, qs, qe, 2 * index + 1),                       RMQUtil(st, mid + 1, se, qs, qe, 2 * index + 2));     }      // Return minimum of elements in range     // from index qs to qe     static int RMQ(int[] st, int n, int qs, int qe) {          // Check for invalid input         if (qs < 0 || qe > n - 1 || qs > qe) {             System.out.println("Invalid Input");             return -1;         }         return RMQUtil(st, 0, n - 1, qs, qe, 0);     }      // A recursive function that constructs     // Segment Tree for array[ss..se].      static int constructSTUtil(int[] arr, int ss,                          int se, int[] st, int si) {          // If there is one element in array,         // store it in current node of          // segment tree and return          if (ss == se) {             st[si] = arr[ss];             return arr[ss];         }          // If there are more than one elements,          // then recur for left and right subtrees          // and store the minimum of two values in this node          int mid = getMid(ss, se);         st[si] = minVal(constructSTUtil(arr, ss, mid, st, si * 2 + 1),                         constructSTUtil(arr, mid + 1, se, st, si * 2 + 2));         return st[si];     }      // Function to construct segment tree     static int[] constructST(int[] arr, int n) {          // Height of segment tree         int x = (int) (Math.ceil(Math.log(n) / Math.log(2)));          // Maximum size of segment tree         int max_size = 2 * (int) Math.pow(2, x) - 1;          int[] st = new int[max_size];          // Fill the allocated memory st         constructSTUtil(arr, 0, n - 1, st, 0);          // Return the constructed segment tree         return st;     }      public static void main(String[] args) {          int[] arr = {1, 3, 2, 7, 9, 11};         int n = arr.length;          // Build segment tree from given array         int[] st = constructST(arr, n);          // Starting index of query range         int qs = 1;          // Ending index of query range         int qe = 5;          // Print minimum value in arr[qs..qe]         System.out.println("Minimum of values in range [" + qs + ", " + qe + "] " +                            "is = " + RMQ(st, n, qs, qe));     } } 
Python
# A utility function to get minimum of two numbers def minVal(x, y):     return x if x < y else y  # A utility function to get the  # middle index from corner indexes. def getMid(s, e):     return s + (e - s) // 2  # A recursive function to get the # minimum value in a given range of array def RMQUtil(st, ss, se, qs, qe, index):      # If segment of this node is a part of given range     # then return the min of the segment     if qs <= ss and qe >= se:         return st[index]      # If segment of this node is outside the range     if se < qs or ss > qe:         return float('inf')      # If a part of this segment     # overlaps with the given range     mid = getMid(ss, se)     return minVal(RMQUtil(st, ss, mid, qs, qe, 2 * index + 1),                   RMQUtil(st, mid + 1, se, qs, qe, 2 * index + 2))  # Return minimum of elements in range # from index qs to qe def RMQ(st, n, qs, qe):      # Check for invalid input     if qs < 0 or qe > n - 1 or qs > qe:         print("Invalid Input")         return -1     return RMQUtil(st, 0, n - 1, qs, qe, 0)  # A recursive function that constructs # Segment Tree for array[ss..se].  def constructSTUtil(arr, ss, se, st, si):      # If there is one element in array,     # store it in current node of      # segment tree and return      if ss == se:         st[si] = arr[ss]         return arr[ss]      # If there are more than one elements,      # then recur for left and right subtrees      # and store the minimum of two values in this node      mid = getMid(ss, se)     st[si] = minVal(constructSTUtil(arr, ss, mid, st, si * 2 + 1),                     constructSTUtil(arr, mid + 1, se, st, si * 2 + 2))     return st[si]  # Function to construct segment tree def constructST(arr, n):      # Height of segment tree     x = (n - 1).bit_length()      # Maximum size of segment tree     max_size = 2 * (2**x) - 1      st = [0] * max_size      # Fill the allocated memory st     constructSTUtil(arr, 0, n - 1, st, 0)      # Return the constructed segment tree     return st  if __name__ == "__main__" :      arr = [1, 3, 2, 7, 9, 11]     n = len(arr)      # Build segment tree from given array     st = constructST(arr, n)      # Starting index of query range     qs = 1      # Ending index of query range     qe = 5      # Print minimum value in arr[qs..qe]     print(f"Minimum of values in range [{qs}, {qe}] is = {RMQ(st, n, qs, qe)}") 
C#
// C# program for range minimum  // query using segment tree using System; using System.Collections.Generic;  class GFG {          // A utility function to get minimum of two numbers     static int minVal(int x, int y) {         return (x < y) ? x : y;     }      // A utility function to get the      // middle index from corner indexes.     static int getMid(int s, int e) {         return s + (e - s) / 2;     }      // A recursive function to get the     // minimum value in a given range of array     static int RMQUtil(int[] st, int ss, int se,                          int qs, int qe, int index) {                                      // If segment of this node is a part of given range         // then return the min of the segment         if (qs <= ss && qe >= se)             return st[index];          // If segment of this node is outside the range         if (se < qs || ss > qe)             return int.MaxValue;          // If a part of this segment         // overlaps with the given range         int mid = getMid(ss, se);         return minVal(RMQUtil(st, ss, mid, qs, qe, 2 * index + 1),                       RMQUtil(st, mid + 1, se, qs, qe, 2 * index + 2));     }      // Return minimum of elements in range     // from index qs to qe     static int RMQ(int[] st, int n, int qs, int qe) {                  // Check for invalid input         if (qs < 0 || qe > n - 1 || qs > qe) {             Console.WriteLine("Invalid Input");             return -1;         }         return RMQUtil(st, 0, n - 1, qs, qe, 0);     }      // A recursive function that constructs     // Segment Tree for array[ss..se].      static int constructSTUtil(int[] arr, int ss,                          int se, int[] st, int si) {                                      // If there is one element in array,         // store it in current node of          // segment tree and return          if (ss == se) {             st[si] = arr[ss];             return arr[ss];         }          // If there are more than one elements,          // then recur for left and right subtrees          // and store the minimum of two values in this node          int mid = getMid(ss, se);         st[si] = minVal(constructSTUtil(arr, ss, mid, st, si * 2 + 1),                         constructSTUtil(arr, mid + 1, se, st, si * 2 + 2));         return st[si];     }      // Function to construct segment tree     static int[] constructST(int[] arr, int n) {                  // Height of segment tree         int x = (int)Math.Ceiling(Math.Log(n) / Math.Log(2));          // Maximum size of segment tree         int max_size = 2 * (int)Math.Pow(2, x) - 1;          int[] st = new int[max_size];          // Fill the allocated memory st         constructSTUtil(arr, 0, n - 1, st, 0);          // Return the constructed segment tree         return st;     }      static void Main() {         int[] arr = {1, 3, 2, 7, 9, 11};         int n = arr.Length;          // Build segment tree from given array         int[] st = constructST(arr, n);          // Starting index of query range         int qs = 1;          // Ending index of query range         int qe = 5;          // Print minimum value in arr[qs..qe]         Console.WriteLine("Minimum of values in range [" + qs + ", " + qe + "] " +                           "is = " + RMQ(st, n, qs, qe));     } } 
JavaScript
// A utility function to get minimum of two numbers function minVal(x, y) {     return (x < y) ? x : y; }  // A utility function to get the  // middle index from corner indexes. function getMid(s, e) {     return s + Math.floor((e - s) / 2); }  // A recursive function to get the // minimum value in a given range of array function RMQUtil(st, ss, se, qs, qe, index) {      // If segment of this node is a part of given range     // then return the min of the segment     if (qs <= ss && qe >= se)         return st[index];      // If segment of this node is outside the range     if (se < qs || ss > qe)         return Number.MAX_SAFE_INTEGER;      // If a part of this segment     // overlaps with the given range     let mid = getMid(ss, se);     return minVal(RMQUtil(st, ss, mid, qs, qe, 2 * index + 1),                   RMQUtil(st, mid + 1, se, qs, qe, 2 * index + 2)); }  // Return minimum of elements in range // from index qs to qe function RMQ(st, n, qs, qe) {      // Check for invalid input     if (qs < 0 || qe > n - 1 || qs > qe) {         console.log("Invalid Input");         return -1;     }     return RMQUtil(st, 0, n - 1, qs, qe, 0); }  // A recursive function that constructs // Segment Tree for array[ss..se].  function constructSTUtil(arr, ss, se, st, si) {      // If there is one element in array,     // store it in current node of      // segment tree and return      if (ss === se) {         st[si] = arr[ss];         return arr[ss];     }      // If there are more than one elements,      // then recur for left and right subtrees      // and store the minimum of two values in this node      let mid = getMid(ss, se);     st[si] = minVal(constructSTUtil(arr, ss, mid, st, si * 2 + 1),                     constructSTUtil(arr, mid + 1, se, st, si * 2 + 2));     return st[si]; }  // Function to construct segment tree function constructST(arr, n) {      // Height of segment tree     let x = Math.ceil(Math.log2(n));      // Maximum size of segment tree     let max_size = 2 * Math.pow(2, x) - 1;      let st = new Array(max_size).fill(0);      // Fill the allocated memory st     constructSTUtil(arr, 0, n - 1, st, 0);      // Return the constructed segment tree     return st; }  // Main function function main() {     let arr = [1, 3, 2, 7, 9, 11];     let n = arr.length;      // Build segment tree from given array     let st = constructST(arr, n);      // Starting index of query range     let qs = 1;      // Ending index of query range     let qe = 5;      // Print minimum value in arr[qs..qe]     console.log(`Minimum of values in range [${qs}, ${qe}] is = ${RMQ(st, n, qs, qe)}`); }  main(); 

Output: 

 Minimum of values in range [1, 5] is = 2

Time Complexity: 

  • Tree Construction: Time Complexity for tree construction is O(n). There are total 2n-1 nodes, and value of every node is calculated only once in tree construction.
  • Query: Time complexity for each query is O(log n). To query a range minimum, we process at most two nodes at every level and number of levels is O(log n). 

Auxiliary Space: O(n),  since n extra space has been taken.

Further read  
https://www.geeksforgeeks.org/range-minimum-query-for-static-array/ 


Next Article
Segment Tree | Range Minimum Query

K

kartik
Improve
Article Tags :
  • Tree
  • Advanced Data Structure
  • DSA
  • array-range-queries
  • Segment-Tree
Practice Tags :
  • Advanced Data Structure
  • Segment-Tree
  • Tree

Similar Reads

    Segment Tree
    Segment Tree is a data structure that allows efficient querying and updating of intervals or segments of an array. It is particularly useful for problems involving range queries, such as finding the sum, minimum, maximum, or any other operation over a specific range of elements in an array. The tree
    3 min read
    Segment tree meaning in DSA
    A segment tree is a data structure used to effectively query and update ranges of array members. It's typically implemented as a binary tree, with each node representing a segment or range of array elements. Segment tree Characteristics of Segment Tree:A segment tree is a binary tree with a leaf nod
    2 min read
    Introduction to Segment Trees - Data Structure and Algorithm Tutorials
    A Segment Tree is used to store information about array intervals in its nodes.It allows efficient range queries over array intervals.Along with queries, it allows efficient updates of array items.For example, we can perform a range summation of an array between the range L to R in O(Log n) while al
    15+ min read
    Persistent Segment Tree | Set 1 (Introduction)
    Prerequisite : Segment Tree Persistency in Data Structure Segment Tree is itself a great data structure that comes into play in many cases. In this post we will introduce the concept of Persistency in this data structure. Persistency, simply means to retain the changes. But obviously, retaining the
    15+ min read
    Segment tree | Efficient implementation
    Let us consider the following problem to understand Segment Trees without recursion.We have an array arr[0 . . . n-1]. We should be able to, Find the sum of elements from index l to r where 0 <= l <= r <= n-1Change the value of a specified element of the array to a new value x. We need to d
    12 min read
    Iterative Segment Tree (Range Maximum Query with Node Update)
    Given an array arr[0 . . . n-1]. The task is to perform the following operation: Find the maximum of elements from index l to r where 0 <= l <= r <= n-1.Change value of a specified element of the array to a new value x. Given i and x, change A[i] to x, 0 <= i <= n-1. Examples: Input:
    14 min read
    Range Sum and Update in Array : Segment Tree using Stack
    Given an array arr[] of N integers. The task is to do the following operations: Add a value X to all the element from index A to B where 0 ? A ? B ? N-1.Find the sum of the element from index L to R where 0 ? L ? R ? N-1 before and after the update given to the array above.Example: Input: arr[] = {1
    15+ min read
    Dynamic Segment Trees : Online Queries for Range Sum with Point Updates
    Prerequisites: Segment TreeGiven a number N which represents the size of the array initialized to 0 and Q queries to process where there are two types of queries: 1 P V: Put the value V at position P.2 L R: Output the sum of values from L to R. The task is to answer these queries. Constraints: 1 ? N
    15+ min read
    Applications, Advantages and Disadvantages of Segment Tree
    First, let us understand why we need it prior to landing on the introduction so as to get why this concept was introduced. Suppose we are given an array and we need to find out the subarray Purpose of Segment Trees: A segment tree is a data structure that deals with a range of queries over an array.
    4 min read

    Lazy Propagation

    Lazy Propagation in Segment Tree
    Segment tree is introduced in previous post with an example of range sum problem. We have used the same "Sum of given Range" problem to explain Lazy propagation   How does update work in Simple Segment Tree? In the previous post, update function was called to update only a single value in array. Ple
    15+ min read
    Lazy Propagation in Segment Tree | Set 2
    Given an array arr[] of size N. There are two types of operations: Update(l, r, x) : Increment the a[i] (l <= i <= r) with value x.Query(l, r) : Find the maximum value in the array in a range l to r (both are included).Examples: Input: arr[] = {1, 2, 3, 4, 5} Update(0, 3, 4) Query(1, 4) Output
    15+ min read
    Flipping Sign Problem | Lazy Propagation Segment Tree
    Given an array of size N. There can be multiple queries of the following types. update(l, r) : On update, flip( multiply a[i] by -1) the value of a[i] where l <= i <= r . In simple terms, change the sign of a[i] for the given range.query(l, r): On query, print the sum of the array in given ran
    15+ 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