Skip to content
geeksforgeeks
  • 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
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA
  • Interview Problems on DP
  • Practice DP
  • MCQs on DP
  • Tutorial on Dynamic Programming
  • Optimal Substructure
  • Overlapping Subproblem
  • Memoization
  • Tabulation
  • Tabulation vs Memoization
  • 0/1 Knapsack
  • Unbounded Knapsack
  • Subset Sum
  • LCS
  • LIS
  • Coin Change
  • Word Break
  • Egg Dropping Puzzle
  • Matrix Chain Multiplication
  • Palindrome Partitioning
  • DP on Arrays
  • DP with Bitmasking
  • Digit DP
  • DP on Trees
  • DP on Graph
Open In App
Next Article:
Minimum time required to cover a Binary Array
Next article icon

Minimum removals required to make a given array Bitonic

Last Updated : 02 Mar, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

Given an array arr[] of size N, the task is to find the minimum number of array elements required to be removed from the array such that the given array is converted to a bitonic array.

Examples:

Input: arr[] = { 2, 1, 1, 5, 6, 2, 3, 1 } 
Output: 3 
Explanation: 
Removing arr[0], arr[1] and arr[5] modifies arr[] to { 1, 5, 6, 3, 1 } 
Since the array elements follow an increasing order followed by a decreasing order, the required output is 3.

Input: arr[] = { 1, 3, 1 } 
Output: 0 
Explanation: 
The given array is already a bitonic array. Therefore, the required output is 3.

Approach: The problem can be solved based on the concept of the longest increasing subsequence problem. Follow the steps below to solve the problem:

  • Initialize a variable, say left[], such that left[i] stores the length of the longest increasing subsequence up to the ith index.
  • Initialize a variable, say right[], such that right[i] stores the length of the longest decreasing subsequence over the range [i, N].
  • Traverse left[] and right[] array using variable i and find the maximum value of (left[i] + right[i] – 1) and store it in a variable, say maxLen.
  • Finally, print the value of N – maxLen.

Below is the implementation of the above approach:

C++14




// C++ program to implement
// the above approach
 
#include <bits/stdc++.h>
using namespace std;
 
// Function to count minimum array elements
// required to be removed to make an array bitonic
void min_element_removal(int arr[], int N)
{
    // left[i]: Stores the length
    // of LIS up to i-th index
    vector<int> left(N, 1);
 
    // right[i]: Stores the length
    // of decreasing subsequence
    // over the range [i, N]
    vector<int> right(N, 1);
 
    // Calculate the length of LIS
    // up to i-th index
    for (int i = 1; i < N; i++) {
 
        // Traverse the array
        // upto i-th index
        for (int j = 0; j < i; j++) {
 
            // If arr[j] is less than arr[i]
            if (arr[j] < arr[i]) {
 
                // Update left[i]
                left[i] = max(left[i],
                              left[j] + 1);
            }
        }
    }
 
    // Calculate the length of decreasing
    // subsequence over the range [i, N]
    for (int i = N - 2; i >= 0;
         i--) {
 
        // Traverse right[] array
        for (int j = N - 1; j > i;
             j--) {
 
            // If arr[i] is greater
            // than arr[j]
            if (arr[i] > arr[j]) {
 
                // Update right[i]
                right[i] = max(right[i],
                               right[j] + 1);
            }
        }
    }
 
    // Stores length of the
    // longest bitonic array
    int maxLen = 0;
 
    // Traverse left[] and right[] array
    for (int i = 1; i < N - 1; i++) {
 
        // Update maxLen
        maxLen = max(maxLen, left[i] + right[i] - 1);
    }
 
    cout << (N - maxLen) << "\n";
}
 
// Function to print minimum removals
// required to make given array bitonic
void makeBitonic(int arr[], int N)
{
    if (N == 1) {
        cout << "0" << endl;
        return;
    }
 
    if (N == 2) {
        if (arr[0] != arr[1])
            cout << "0" << endl;
        else
            cout << "1" << endl;
 
        return;
    }
 
    min_element_removal(arr, N);
}
 
// Driver Code
int main()
{
    int arr[] = { 2, 1, 1, 5, 6, 2, 3, 1 };
    int N = sizeof(arr) / sizeof(arr[0]);
 
    makeBitonic(arr, N);
 
    return 0;
}
 
 

C




// C program to implement
// the above approach
#include <stdio.h>
#define max(a,b) ((a) > (b) ? (a) : (b)) //defining max
 
// Function to count minimum array elements
// required to be removed to make an array bitonic
void min_element_removal(int arr[], int N)
{
   
  // left[i]: Stores the length
  // of LIS up to i-th index
  int left[N];
  for (int i = 0; i < N; i++)
    left[i] = 1;
 
  // right[i]: Stores the length
  // of decreasing subsequence
  // over the range [i, N]
  int right[N];
  for (int i = 0; i < N; i++)
    right[i] = 1;
 
  // Calculate the length of LIS
  // up to i-th index
  for (int i = 1; i < N; i++) {
 
    // Traverse the array
    // upto i-th index
    for (int j = 0; j < i; j++) {
 
      // If arr[j] is less than arr[i]
      if (arr[j] < arr[i]) {
 
        // Update left[i]
        left[i] = max(left[i], left[j] + 1);
      }
    }
  }
 
  // Calculate the length of decreasing
  // subsequence over the range [i, N]
  for (int i = N - 2; i >= 0;
       i--) {
 
    // Traverse right[] array
    for (int j = N - 1; j > i;
         j--) {
 
      // If arr[i] is greater
      // than arr[j]
      if (arr[i] > arr[j]) {
 
        // Update right[i]
        right[i] = max(right[i],  right[j] + 1);
      }
    }
  }
 
  // Stores length of the
  // longest bitonic array
  int maxLen = 0;
 
  // Traverse left[] and right[] array
  for (int i = 1; i < N - 1; i++) {
 
    // Update maxLen
    maxLen = max(maxLen, left[i] + right[i] - 1);
  }
 
  printf("%d\n", (N - maxLen));
}
 
// Function to print minimum removals
// required to make given array bitonic
void makeBitonic(int arr[], int N)
{
  if (N == 1) {
    printf("0\n");
    return;
  }
 
  if (N == 2) {
    if (arr[0] != arr[1])
      printf("0\n");
    else
      printf("1\n");
 
    return;
  }
 
  min_element_removal(arr, N);
}
 
// Driver Code
int main()
{
  int arr[] = { 2, 1, 1, 5, 6, 2, 3, 1 };
  int N = sizeof(arr) / sizeof(arr[0]);
 
  makeBitonic(arr, N);
 
  return 0;
}
 
// This code is contributed by phalashi.
 
 

Java




// Java program to implement
// the above approach
class GFG {
     
    // Function to count minimum array elements
    // required to be removed to make an array bitonic
    static void min_element_removal(int arr[], int N)
    {
        // left[i]: Stores the length
        // of LIS up to i-th index
        int left[] = new int[N];
         
        for(int i = 0; i < N; i++)
            left[i] = 1;
     
        // right[i]: Stores the length
        // of decreasing subsequence
        // over the range [i, N]
        int right[] = new int[N];
         
        for(int i = 0; i < N; i++)
            right[i] = 1;
             
        // Calculate the length of LIS
        // up to i-th index
        for (int i = 1; i < N; i++) {
     
            // Traverse the array
            // upto i-th index
            for (int j = 0; j < i; j++) {
     
                // If arr[j] is less than arr[i]
                if (arr[j] < arr[i]) {
     
                    // Update left[i]
                    left[i] = Math.max(left[i],
                                  left[j] + 1);
                }
            }
        }
     
        // Calculate the length of decreasing
        // subsequence over the range [i, N]
        for (int i = N - 2; i >= 0;
             i--) {
     
            // Traverse right[] array
            for (int j = N - 1; j > i;
                 j--) {
     
                // If arr[i] is greater
                // than arr[j]
                if (arr[i] > arr[j]) {
     
                    // Update right[i]
                    right[i] = Math.max(right[i],
                                   right[j] + 1);
                }
            }
        }
     
        // Stores length of the
        // longest bitonic array
        int maxLen = 0;
     
        // Traverse left[] and right[] array
        for (int i = 1; i < N - 1; i++) {
     
            // Update maxLen
            maxLen = Math.max(maxLen, left[i] + right[i] - 1);
        }
     
        System.out.println(N - maxLen);
    }
     
    // Function to print minimum removals
    // required to make given array bitonic
    static void makeBitonic(int arr[], int N)
    {
        if (N == 1) {
            System.out.println("0");
            return;
        }
     
        if (N == 2) {
            if (arr[0] != arr[1])
                System.out.println("0");
            else
                System.out.println("1");
     
            return;
        }
     
        min_element_removal(arr, N);
    }
     
    // Driver Code
    public static void main (String[] args) {
         
        int arr[] = { 2, 1, 1, 5, 6, 2, 3, 1 };
         
        int N = arr.length;
     
        makeBitonic(arr, N);
    }
}
 
// This code is contributed by AnkitRai01
 
 

Python3




# Python3 program to implement
# the above approach
 
# Function to count minimum array elements
# required to be removed to make an array bitonic
def min_element_removal(arr, N):
     
    # left[i]: Stores the length
    # of LIS up to i-th index
    left = [1] * N
 
    # right[i]: Stores the length
    # of decreasing subsequence
    # over the range [i, N]
    right = [1] * (N)
 
    #Calculate the length of LIS
    #up to i-th index
    for i in range(1, N):
 
        #Traverse the array
        #upto i-th index
        for j in range(i):
 
            #If arr[j] is less than arr[i]
            if (arr[j] < arr[i]):
 
                #Update left[i]
                left[i] = max(left[i], left[j] + 1)
 
    # Calculate the length of decreasing
    # subsequence over the range [i, N]
    for i in range(N - 2, -1, -1):
 
        # Traverse right[] array
        for j in range(N - 1, i, -1):
 
            # If arr[i] is greater
            # than arr[j]
            if (arr[i] > arr[j]):
 
                # Update right[i]
                right[i] = max(right[i], right[j] + 1)
 
    # Stores length of the
    # longest bitonic array
    maxLen = 0
 
    # Traverse left[] and right[] array
    for i in range(1, N - 1):
 
        # Update maxLen
        maxLen = max(maxLen, left[i] + right[i] - 1)
 
    print((N - maxLen))
 
# Function to print minimum removals
# required to make given array bitonic
def makeBitonic(arr, N):
    if (N == 1):
        print("0")
        return
 
    if (N == 2):
        if (arr[0] != arr[1]):
            print("0")
        else:
            print("1")
 
        return
 
    min_element_removal(arr, N)
 
# Driver Code
if __name__ == '__main__':
    arr=[2, 1, 1, 5, 6, 2, 3, 1]
    N = len(arr)
 
    makeBitonic(arr, N)
 
    # This code is contributed by mohit kumar 29
 
 

C#




// C# program to implement
// the above approach
using System;
 
class GFG{
     
// Function to count minimum array elements
// required to be removed to make an array bitonic
static void min_element_removal(int []arr, int N)
{
     
    // left[i]: Stores the length
    // of LIS up to i-th index
    int []left = new int[N];
     
    for(int i = 0; i < N; i++)
        left[i] = 1;
 
    // right[i]: Stores the length
    // of decreasing subsequence
    // over the range [i, N]
    int []right = new int[N];
     
    for(int i = 0; i < N; i++)
        right[i] = 1;
         
    // Calculate the length of LIS
    // up to i-th index
    for(int i = 1; i < N; i++)
    {
         
        // Traverse the array
        // upto i-th index
        for(int j = 0; j < i; j++)
        {
             
            // If arr[j] is less than arr[i]
            if (arr[j] < arr[i])
            {
                 
                // Update left[i]
                left[i] = Math.Max(left[i],
                                   left[j] + 1);
            }
        }
    }
 
    // Calculate the length of decreasing
    // subsequence over the range [i, N]
    for(int i = N - 2; i >= 0; i--)
    {
         
        // Traverse right[] array
        for(int j = N - 1; j > i; j--)
        {
             
            // If arr[i] is greater
            // than arr[j]
            if (arr[i] > arr[j])
            {
                 
                // Update right[i]
                right[i] = Math.Max(right[i],
                                    right[j] + 1);
            }
        }
    }
 
    // Stores length of the
    // longest bitonic array
    int maxLen = 0;
 
    // Traverse left[] and right[] array
    for(int i = 1; i < N - 1; i++)
    {
         
        // Update maxLen
        maxLen = Math.Max(maxLen, left[i] +
                                 right[i] - 1);
    }
    Console.WriteLine(N - maxLen);
}
 
// Function to print minimum removals
// required to make given array bitonic
static void makeBitonic(int []arr, int N)
{
    if (N == 1)
    {
        Console.WriteLine("0");
        return;
    }
 
    if (N == 2)
    {
        if (arr[0] != arr[1])
            Console.WriteLine("0");
        else
            Console.WriteLine("1");
             
        return;
    }
    min_element_removal(arr, N);
}
 
// Driver Code
public static void Main(String[] args)
{
    int []arr = { 2, 1, 1, 5, 6, 2, 3, 1 };
    int N = arr.Length;
 
    makeBitonic(arr, N);
}
}
 
// This code is contributed by AnkThon
 
 

Javascript




<script>
 
// Javascript program to implement
// the above approach
 
// Function to count minimum array elements
// required to be removed to make an array bitonic
function min_element_removal(arr, N)
{
    // left[i]: Stores the length
    // of LIS up to i-th index
    var left = Array(N).fill(1);
 
    // right[i]: Stores the length
    // of decreasing subsequence
    // over the range [i, N]
    var right = Array(N).fill(1);
 
    // Calculate the length of LIS
    // up to i-th index
    for (var i = 1; i < N; i++) {
 
        // Traverse the array
        // upto i-th index
        for (var j = 0; j < i; j++) {
 
            // If arr[j] is less than arr[i]
            if (arr[j] < arr[i]) {
 
                // Update left[i]
                left[i] = Math.max(left[i],
                              left[j] + 1);
            }
        }
    }
 
    // Calculate the length of decreasing
    // subsequence over the range [i, N]
    for (var i = N - 2; i >= 0;
         i--) {
 
        // Traverse right[] array
        for (var j = N - 1; j > i;
             j--) {
 
            // If arr[i] is greater
            // than arr[j]
            if (arr[i] > arr[j]) {
 
                // Update right[i]
                right[i] = Math.max(right[i],
                               right[j] + 1);
            }
        }
    }
 
    // Stores length of the
    // longest bitonic array
    var maxLen = 0;
 
    // Traverse left[] and right[] array
    for (var i = 1; i < N - 1; i++) {
 
        // Update maxLen
        maxLen = Math.max(maxLen, left[i] + right[i] - 1);
    }
 
    document.write((N - maxLen) + "<br>");
}
 
// Function to print minimum removals
// required to make given array bitonic
function makeBitonic(arr, N)
{
    if (N == 1) {
        document.write( "0" + "<br>");
        return;
    }
 
    if (N == 2) {
        if (arr[0] != arr[1])
            document.write( "0" + "<br>");
        else
            document.write( "1" + "<br>");
 
        return;
    }
 
    min_element_removal(arr, N);
}
 
// Driver Code
var arr = [2, 1, 1, 5, 6, 2, 3, 1];
var N = arr.length;
makeBitonic(arr, N);
 
// This code is contributed by rutvik_56.
</script>
 
 
Output: 
3

 

Time Complexity: O(N2) 
Auxiliary Space: O(N)

Optimized Approach:

This approach has a time complexity of O(n), where n is the number of elements in the array, since it takes a single pass through the array to find the local maximum and local minimum, and it performs a constant amount of work for each iteration of the loop.

C++




#include <bits/stdc++.h>
using namespace std;
 
// Function to count minimum array elements
// required to be removed to make an array bitonic
void min_element_removal(int arr[], int N)
{
    int l = 0, r = N-1, count = 0;
    while(l < r)
    {
        // find the first local maximum from the left side
        while(l < N-1 && arr[l] <= arr[l+1])
            l++;
 
        // find the first local minimum from the right side
        while(r > 0 && arr[r] <= arr[r-1])
            r--;
 
        // if both indices have not crossed each other,
        // remove the elements between them
        if(l < r)
        {
            l++;
            r--;
            count++;
        }
    }
 
    // print the minimum number of removals
    cout << count << endl;
}
 
// Driver Code
int main()
{
    int arr[] = { 5,7,1,3,6,2,1 };
    int N = sizeof(arr) / sizeof(arr[0]);
 
    min_element_removal(arr, N);
 
    return 0;
}
 
 

Java




import java.util.*;
 
class Main {
    // Function to count minimum array elements
    // required to be removed to make an array bitonic
    public static void min_element_removal(int arr[], int N)
    {
        int l = 0, r = N - 1, count = 0;
        while (l < r) {
            // find the first local maximum from the left
            // side
            while (l < N - 1 && arr[l] <= arr[l + 1])
                l++;
 
            // find the first local minimum from the right
            // side
            while (r > 0 && arr[r] <= arr[r - 1])
                r--;
 
            // if both indices have not crossed each other,
            // remove the elements between them
            if (l < r) {
                l++;
                r--;
                count++;
            }
        }
 
        // print the minimum number of removals
        System.out.println(count);
    }
 
    // Driver Code
    public static void main(String[] args)
    {
        int arr[] = { 5, 7, 1, 3, 6, 2, 1 };
        int N = arr.length;
 
        min_element_removal(arr, N);
    }
}
 
 

Python3




# Function to count minimum array elements
# required to be removed to make an array bitonic
def min_element_removal(arr, N):
    l, r, count = 0, N-1, 0
    while l < r:
       
        # find the first local maximum from the left side
        while l < N-1 and arr[l] <= arr[l+1]:
            l += 1
 
        # find the first local minimum from the right side
        while r > 0 and arr[r] <= arr[r-1]:
            r -= 1
 
        # if both indices have not crossed each other,
        # remove the elements between them
        if l < r:
            l += 1
            r -= 1
            count += 1
 
    # print the minimum number of removals
    print(count)
 
 
# Driver Code
arr = [5, 7, 1, 3, 6, 2, 1]
N = len(arr)
 
min_element_removal(arr, N)
 
 

Javascript




// Function to count minimum array elements
// required to be removed to make an array bitonic
function min_element_removal(arr, N) {
  let l = 0, r = N-1, count = 0;
  while (l < r) {
       
    // find the first local maximum from the left side
    while (l < N-1 && arr[l] <= arr[l+1]) {
      l++;
    }
 
    // find the first local minimum from the right side
    while (r > 0 && arr[r] <= arr[r-1]) {
      r--;
    }
 
    // if both indices have not crossed each other,
    // remove the elements between them
    if (l < r) {
      l++;
      r--;
      count++;
    }
  }
 
  // print the minimum number of removals
  console.log(count);
}
 
// Driver Code
let arr = [5, 7, 1, 3, 6, 2, 1];
let N = arr.length;
 
min_element_removal(arr, N);
 
 

C#




using System;
 
class Program
{
    static void Main(string[] args)
    {
        int[] arr = { 5, 7, 1, 3, 6, 2, 1 };
        int N = arr.Length;
 
        int l = 0, r = N - 1, count = 0;
        while (l < r)
        {
            // find the first local maximum from the left side
            while (l < N - 1 && arr[l] <= arr[l + 1])
                l++;
 
            // find the first local minimum from the right side
            while (r > 0 && arr[r] <= arr[r - 1])
                r--;
 
            // if both indices have not crossed each other,
            // remove the elements between them
            if (l < r)
            {
                l++;
                r--;
                count++;
            }
        }
 
        // print the minimum number of removals
        Console.WriteLine(count);
    }
}
 
 
Output
1

Time Complexity: O(N) 
Auxiliary Space: O(N)



Next Article
Minimum time required to cover a Binary Array
author
saikumarkudikala
Improve
Article Tags :
  • Arrays
  • DSA
  • Dynamic Programming
  • Mathematical
  • Searching
  • bitonic
  • subsequence
Practice Tags :
  • Arrays
  • Dynamic Programming
  • Mathematical
  • Searching

Similar Reads

  • Minimum time required to cover a Binary Array
    Given an integer N which represents the size of a boolean array that is initially filled with 0, and also given an array arr[] of size K consisting of (1-based) indices at which '1' are present in the boolean array. Now, at one unit of time the adjacent cells of the arr[i] in the boolean array becom
    8 min read
  • Minimum number of moves to make a binary array K periodic
    Given a binary array arr[] (containing only 0s and 1s) and an integer K. The task is to find the minimum number of moves to make the array K-periodic. An array is said to be K-periodic if the sub-arrays [1 to K], [k+1 to 2K], [2k+1 to 3K], ... are all exactly same. In a single move any 1 can be chan
    6 min read
  • Minimum subarray reversals required to make given binary array alternating
    Given a binary array arr[] consisting of equal count of 0s and 1s, the task is to count the minimum number of subarray reversal operations required to make the binary array alternating. In each operation reverse any subarray of the given array. Examples: Input: arr[] = { 1, 1, 1, 0, 1, 0, 0, 0 } Out
    5 min read
  • Minimum operations required to make two elements equal in Array
    Given array A[] of size N and integer X, the task is to find the minimum number of operations to make any two elements equal in the array. In one operation choose any element A[i] and replace it with A[i] & X. where & is bitwise AND. If such operations do not exist print -1. Examples: Input:
    9 min read
  • Minimum value to be added to maximize Bitwise XOR of the given array
    Given an array arr[] consisting of N integers, the task is to find an integer K, not having more than maximum bits present in any array element, which when added to the array, maximizes the Bitwise XOR of the array. Examples: Input: N = 7, arr[] = {1, 7, 8, 11, 6, 9, 6}Output: 3Explanation:Bitwise X
    6 min read
  • Minimum no. of operations required to make all Array Elements Zero
    Given an array of N elements and each element is either 1 or 0. You need to make all the elements of the array equal to 0 by performing the below operations: If an element is 1, You can change it's value equal to 0 then, if the next consecutive element is 1, it will automatically get converted to 0.
    12 min read
  • Minimize count of flips required to make sum of the given array equal to 0
    Given an array arr[] consisting of N integers, the task is to minimize the count of elements required to be multiplied by -1 such that the sum of array elements is 0. If it is not possible to make the sum 0, print "-1". Examples: Input: arr[] = {2, 3, 1, 4}Output: 2Explanation: Multiply arr[0] by -1
    15+ min read
  • Minimum increment/decrement operations required on Array to satisfy given conditions
    Given an array arr[] of size N, the task is to find the minimum number of increment or decrement operations required at any index i such that for each i (1 ? i < N) if the sum of elements at index from 1 to i is positive then the sum of elements from 1 to i + 1 must be negative or vice versa. Not
    11 min read
  • Find minimum operations needed to make an Array beautiful
    Given a binary array( consider it as cyclic with start and end tied together) of length N having only one's and zero's where [Tex]2\leq N \leq 10^{6} [/Tex]. The task is to find minimum operation needed to make the array beautiful. An array is said to be beautiful if it has no consecutive ones or ze
    7 min read
  • Minimum count of increment of K size subarrays required to form a given Array
    Given an array arr[] and an integer K, the task is to find the minimum number of operations required to change an array B of size N containing all zeros such that every element of B is greater than or equal to arr. i.e., arr[i] >= B[i]. In any operation, you can choose a subarray of B of size K a
    8 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