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
  • Practice Sorting
  • MCQs on Sorting
  • Tutorial on Sorting
  • Bubble Sort
  • Quick Sort
  • Merge Sort
  • Insertion Sort
  • Selection Sort
  • Heap Sort
  • Sorting Complexities
  • Radix Sort
  • ShellSort
  • Counting Sort
  • Bucket Sort
  • TimSort
  • Bitonic Sort
  • Uses of Sorting Algorithm
Open In App
Next Article:
Advanced Quick Sort (Hybrid Algorithm)
Next article icon

Implement Quicksort with first element as pivot

Last Updated : 27 May, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

QuickSort is a Divide and Conquer algorithm. It picks an element as a pivot and partitions the given array around the pivot. There are many different versions of quickSort that pick the pivot in different ways. 

  • Always pick the first element as a pivot.
  • Always pick the last element as a pivot.
  • Pick a random element as a pivot.
  • Pick the median as the pivot.

Note: Here we will be implementing quick sort by picking the first element as the pivot.

Quick Sort by picking the first element as the Pivot:

The key function in quick sort is a partition. The target of partitions is to put the pivot in its correct position if the array is sorted and the smaller (or equal) to its left and higher elements to its right and do all this in linear time.

Partition Algorithm:

There can be many ways to do partition, the following pseudo-code adopts the method given in the CLRS book.

  • We start from the leftmost element and keep track of the index of smaller (or equal) elements as i. 
  • While traversing, if we find a smaller (or equal) element, we swap the current element with arr[i]. 
  • Otherwise, we ignore the current element.

Pseudo Code for recursive QuickSort function:

// low  –> Starting index,  high  –> Ending index

quickSort(arr[], low, high) {
    if (low < high) {
        
        // pi is partitioning index, arr[pi] is now at right place
        pi = partition(arr, low, high);
        quickSort(arr, low, pi – 1);  // Before pi
        quickSort(arr, pi + 1, high); // After pi
    }
}

Pseudo code for partition() function

/* This function takes first element as pivot, places the pivot element at its correct position in sorted array, and places all smaller (smaller than or equal to pivot) to left of pivot and all greater elements to right of pivot */

partition (arr[], low, high) {
    // first element as pivot
    pivot = arr[low]
    k = high
    for (i = high; i > low; i--) {
        if (arr[i] > pivot){
            swap arr[i] and arr[k];
            k--;
        }
    }
    swap arr[k] and arr[low]
    return k;
}

Illustration of partition() : 

Consider: arr[] = { 7,   6,   10,   5,   9,   2,   1,   15,   7 }

First Partition: low = 0, high = 8, pivot = arr[low] = 7
Initialize index of right most element k = high = 8.

  • Traverse from i = high to low:
    • if arr[i] is greater than pivot:
      • Swap arr[i] and arr[k].
      • Decrement k;
  • At the end swap arr[low] and arr[k].

Now the correct position of pivot is index 5

First partition
First partition

Second Partition: low = 0, high = 4, pivot = arr[low] = 2
Similarly initialize k = high = 4; 

The correct position of 2 becomes index 1. And the left part is only one element and the right part has {6, 5, 7}.

Partition of the left half
Partition of the left half

On the other hand partition happens on the segment [6, 8] i.e., the array {10, 9, 15}.
Here low = 6, high = 8, pivot = 10 and k = 8.

The correct position of 10 becomes index 7 and the right and left part both has only one element.

Partition of the right half

Third partition:  Here partition the segment {6, 5, 7}. The low = 2, high = 4, pivot = 6 and k = 4.
If the same process is applied, we get correct position of 6 as index 3 and the left and the right part is having only one element.

Third partition
Third partition

The total array becomes sorted in this way. Check the below image for the recursion tree

Recursion tree for partitions
Recursion tree for partitions

Follow the below steps to implement the approach.

  • Use a recursive function (say quickSort) to initialize the function.
  • Call the partition function to partition the array and inside the partition function do the following
    • Take the first element as pivot and initialize and iterator k = high.
    • Iterate in a for loop from i = high to low+1:
      • If arr[i] is greater than pivot then swap arr[i] and arr[k] and decrement k.
    • After the iteration is swap the pivot with arr[k].
    • Return k-1 as the point of partition.
  • Now recursively call quickSort for the left half and right half of the partition index.

Implementation of the above approach.

C++
#include <bits/stdc++.h> using namespace std;  /*This function takes first element as pivot, the function places the pivot element(first element) on its sorted position and all the element lesser than pivot will placed left to it, and all the element greater than pivot placed right to it.*/  int partition(int arr[], int low, int high) {      // First element as pivot     int pivot = arr[low];       int k = high;     for (int i = high; i > low; i--) {         if (arr[i] > pivot)             swap(arr[i], arr[k--]);     }     swap(arr[low], arr[k]);     // As we got pivot element index is end     // now pivot element is at its sorted position     // return pivot element index (end)     return k; }  /* The main function that implements QuickSort arr[] --> Array to be sorted, low --> Starting index, high --> Ending index */ void quickSort(int arr[], int low, int high) {     // If low is lesser than high     if (low < high) {         // idx is index of pivot element which is at its         // sorted position         int idx = partition(arr, low, high);          // Separately sort elements before         // partition and after partition         quickSort(arr, low, idx - 1);         quickSort(arr, idx + 1, high);     } }  /* Function to print an array */ void printArray(int arr[], int size) {     int i;     for (i = 0; i < size; i++)         cout << arr[i] << " ";     cout << endl; }  // Driver Code int main() {     int arr[] = { 7, 6, 10, 5, 9, 2, 1, 15, 7 };     int n = sizeof(arr) / sizeof(arr[0]);     quickSort(arr, 0, n - 1);     cout << "Sorted array: \n";     printArray(arr, n);     return 0; }  // This Code is contributed by Harsh Raghav 
C
#include <stdio.h>  void swap(int *a, int *b) {     int temp = *a;     *a = *b;     *b = temp; }  int partition(int arr[], int low, int high) {     int pivot = arr[low]; // Choosing the pivot element     int start = low;     int end = high;     int k = high;      // Iterate from the end of the array to the start     for (int i = high; i > low; i--) {         // If the current element is greater than the pivot,         // swap it with the element at index k and decrement k         if (arr[i] > pivot)             swap(&arr[i], &arr[k--]);     }      // Swap the pivot element with the element at index k     swap(&arr[low], &arr[k]);      return k; // Return the index of the pivot element after partitioning }  void quickSort(int arr[], int low, int high) {     if (low < high) {         // Partition the array and get the index of the pivot element         int idx = partition(arr, low, high);          // Recursively sort the subarrays before and after the pivot element         quickSort(arr, low, idx - 1);         quickSort(arr, idx + 1, high);     } }  void printArray(int arr[], int size) {     for (int i = 0; i < size; i++)         printf("%d ", arr[i]);     printf("\n"); }  int main() {     int arr[] = {7, 6, 10, 5, 9, 2, 1, 15, 7};     int n = sizeof(arr) / sizeof(arr[0]);      // Call quickSort to sort the array     quickSort(arr, 0, n - 1);      printf("Sorted array: \n");     printArray(arr, n);      return 0; } 
Java
import java.util.Arrays;  class QuickSort {     /* This function takes first element as pivot, the     function places the pivot element(first element) on its     sorted position and all the element lesser than pivot     will placed left to it, and all the element greater than     pivot placed right to it.*/     int partition(int arr[], int low, int high)     {         // First element as pivot         int pivot = arr[low];         int st = low; // st points to the starting of array         int end             = high; // end points to the ending of the array         int k = high;         for (int i = high; i > low; i--) {             if (arr[i] > pivot)                 swap(arr, i, k--);         }         swap(arr, low, k);         // As we got pivot element index is end         // now pivot element is at its sorted position         // return pivot element index (end)         return k;     }      // Function to swap two elements     public static void swap(int[] arr, int i, int j)     {         int temp = arr[i];         arr[i] = arr[j];         arr[j] = temp;     }      /* The main function that implements QuickSort     arr[] --> Array to be sorted,     low --> Starting index,     high --> Ending index */     void quickSort(int arr[], int low, int high)     {         // If low is lesser than high         if (low < high) {             // idx is index of pivot element which is at its             // sorted position             int idx = partition(arr, low, high);              // Separately sort elements before             // partition and after partition             quickSort(arr, low, idx - 1);             quickSort(arr, idx + 1, high);         }     }      /* Function to print an array */     void printArray(int arr[], int size)     {         int i;         for (i = 0; i < size; i++)             System.out.print(arr[i] + " ");         System.out.println();     }      // Driver Code     public static void main(String args[])     {         int arr[] = { 7, 6, 10, 5, 9, 2, 1, 15, 7 };         int n = arr.length;          QuickSort ob = new QuickSort();         ob.quickSort(arr, 0, n - 1);          System.out.println("Sorted array");         ob.printArray(arr, n);     } } 
Python
# This function takes first element as pivot, the function # places the pivot element(first element) on its sorted # position and all the element lesser than pivot will placed # left to it, and all the element greater than pivot placed # right to it. def partition(array, low, high):        # First Element as pivot     pivot = array[low]          # st points to the starting of array     start = low + 1          # end points to the ending of the array     end = high      while True:         # It indicates we have already moved all the elements to their correct side of the pivot         while start <= end and array[end] >= pivot:             end = end - 1          # Opposite process         while start <= end and array[start] <= pivot:             start = start + 1          # Case in which we will exit the loop         if start <= end:             array[start], array[end] = array[end], array[start]             # The loop continues         else:             # We exit out of the loop             break      array[low], array[end] = array[end], array[low]     # As we got pivot element index is end     # now pivot element is at its sorted position     # return pivot element index (end)     return end  # The main function that implements QuickSort # arr[] --> Array to be sorted, # low --> Starting index, # high --> Ending index def quick_sort(array, start, end):      # If low is lesser than high     if start < end:                # idx is index of pivot element which is at its         # sorted position         idx = partition(array, start, end)                  # Separately sort elements before         # partition and after partition         quick_sort(array, start, idx-1)         quick_sort(array, idx+1, end)  # Function to print an array def print_arr(arr, n):     for i in range(n):         print(arr[i], end=" ")     print()  # Driver Code arr1 = [7, 6, 10, 5, 9, 2, 1, 15, 7] quick_sort(arr1, 0, len(arr1)-1) print_arr(arr1, len(arr1))  # This code is contributed by Aditya Sharma 
C#
using System;  class QuickSort {     /* This function takes first element as pivot, the     function places the pivot element(first element) on its     sorted position and all the element lesser than pivot     will placed left to it, and all the element greater than     pivot placed right to it.*/     int partition(int[] arr, int low, int high)     {         // First element as pivot         int pivot = arr[low];         int st = low; // st points to the starting of array         int end = high; // end points to the ending of the array         int k = high;         for (int i = high; i > low; i--)         {             if (arr[i] > pivot)             {                 swap(arr, i, k--);             }         }         swap(arr, low, k);         // As we got pivot element index is end         // now pivot element is at its sorted position         // return pivot element index (end)         return k;     }      // Function to swap two elements     public static void swap(int[] arr, int i, int j)     {         int temp = arr[i];         arr[i] = arr[j];         arr[j] = temp;     }      /* The main function that implements QuickSort     arr[] --> Array to be sorted,     low --> Starting index,     high --> Ending index */     void quickSort(int[] arr, int low, int high)     {         // If low is lesser than high         if (low < high)         {             // idx is index of pivot element which is at its             // sorted position             int idx = partition(arr, low, high);              // Separately sort elements before             // partition and after partition             quickSort(arr, low, idx - 1);             quickSort(arr, idx + 1, high);         }     }      /* Function to print an array */     void printArray(int[] arr, int size)     {         int i;         for (i = 0; i < size; i++)             Console.Write(arr[i] + " ");         Console.WriteLine();     }      // Driver Code     public static void Main()     {         int[] arr = { 7, 6, 10, 5, 9, 2, 1, 15, 7 };         int n = arr.Length;          QuickSort ob = new QuickSort();         ob.quickSort(arr, 0, n - 1);          Console.WriteLine("Sorted array");         ob.printArray(arr, n);     } } 
JavaScript
function partition(function partition(array, low, high) {   // First Element as pivot   let pivot = array[low];    // st points to the starting of array   let start = low + 1;    // end points to the ending of the array   let end = high;    while (true) {     // It indicates we have already moved all the elements to their correct side of the pivot     while (start <= end && array[end] >= pivot) {       end--;     }      // Opposite process     while (start <= end && array[start] <= pivot) {       start++;     }      // Case in which we will exit the loop     if (start <= end) {       [array[start], array[end]] = [array[end], array[start]];       // The loop continues     } else {       // We exit out of the loop       break;     }   }    [array[low], array[end]] = [array[end], array[low]];   // As we got pivot element index is end   // now pivot element is at its sorted position   // return pivot element index (end)   return end; }  function quick_sort(array, start, end) {   // If low is lesser than high   if (start < end) {     // idx is index of pivot element which is at its     // sorted position     let idx = partition(array, start, end);      // Separately sort elements before     // partition and after partition     quick_sort(array, start, idx - 1);     quick_sort(array, idx + 1, end);   } }  function print_arr(arr) {   console.log(arr.join(" ")); }  // Driver Code let arr1 = [7, 6, 10, 5, 9, 2, 1, 15, 7]; quick_sort(arr1, 0, arr1.length - 1); console.log("Sorted array: "); print_arr(arr1);   //contributed by Aditya Sharma 

Output
Sorted array:  1 2 5 6 7 7 9 10 15  

Complexity Analysis:

  • Time Complexity:
    • Average Case: O(N * logN), where N is the length of the array.
    • Best Case: O(N * logN)
    • Worst Case: O(N2)
  • Auxiliary Space: O(1)

Next Article
Advanced Quick Sort (Hybrid Algorithm)

H

harshraghav718
Improve
Article Tags :
  • Sorting
  • DSA
  • Quick Sort
Practice Tags :
  • Sorting

Similar Reads

    Quick Sort
    QuickSort is a sorting algorithm based on the Divide and Conquer that picks an element as a pivot and partitions the given array around the picked pivot by placing the pivot in its correct position in the sorted array. It works on the principle of divide and conquer, breaking down the problem into s
    12 min read
    Time and Space Complexity Analysis of Quick Sort
    The time complexity of Quick Sort is O(n log n) on average case, but can become O(n^2) in the worst-case. The space complexity of Quick Sort in the best case is O(log n), while in the worst-case scenario, it becomes O(n) due to unbalanced partitioning causing a skewed recursion tree that requires a
    4 min read
    Application and uses of Quicksort
    Quicksort: Quick sort is a Divide Conquer algorithm and the fastest sorting algorithm. In quick sort, it creates two empty arrays to hold elements less than the pivot element and the element greater than the pivot element and then recursively sort the sub-arrays. There are many versions of Quicksort
    2 min read

    QuickSort using different languages

    C++ Program for Quick Sort
    Quick Sort is one of the most efficient sorting algorithms available to sort the given dataset. It is known for its efficiency in handling large datasets which made it a go-to choice for programmers looking to optimize their code.In C++, the STL's sort() function uses a mix of different sorting algo
    4 min read
    Java Program for QuickSort
    Like Merge Sort, QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many different versions of QuickSort that pick pivot in different ways.Always pick first element as pivot.Always pick last element as pivot (im
    2 min read
    QuickSort - Python
    QuickSort is a sorting algorithm based on the Divide and Conquer that picks an element as a pivot and partitions the given array around the picked pivot by placing the pivot in its correct position in the sorted array.How does QuickSort Algorithm work?QuickSort works on the principle of divide and c
    4 min read
    p5.js | Quick Sort
    QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways. Always pick first element as pivot. Always pick last element as pivot. Pick a random ele
    3 min read

    Iterative QuickSort

    Iterative Quick Sort
    Following is a typical recursive implementation of Quick Sort that uses last element as pivot. C++// CPP code for recursive function of Quicksort #include <bits/stdc++.h> using namespace std; /* This function takes last element as pivot, places the pivot element at its correct position in sort
    15+ min read
    C Program for Iterative Quick Sort
    C // An iterative implementation of quick sort #include <stdio.h> // A utility function to swap two elements void swap(int* a, int* b) { int t = *a; *a = *b; *b = t; } /* This function is same in both iterative and recursive*/ int partition(int arr[], int l, int h) { int x = arr[h]; int i = (l
    4 min read
    Java Program for Iterative Quick Sort
    Below is the implementation of Iterative Quick Sort:Java// Java implementation of iterative quick sort import java.io.*; public class IterativeQuickSort { void swap(int arr[], int i, int j) { int t = arr[i]; arr[i] = arr[j]; arr[j] = t; } /* This function is same in both iterative and recursive*/ in
    3 min read
    Python Program for Iterative Quick Sort
    The code consists of two main functions: partition and quickSortIterative, along with a driver code to test the sorting process. The partition function is used for the process of partitioning a given subarray into two parts - elements less than or equal to the chosen pivot (arr[h]) on the left and e
    4 min read

    Different implementations of QuickSort

    QuickSort using Random Pivoting
    In this article, we will discuss how to implement QuickSort using random pivoting. In QuickSort we first partition the array in place such that all elements to the left of the pivot element are smaller, while all elements to the right of the pivot are greater than the pivot. Then we recursively call
    15+ min read
    QuickSort Tail Call Optimization (Reducing worst case space to Log n )
    Prerequisite : Tail Call EliminationIn QuickSort, partition function is in-place, but we need extra space for recursive function calls. A simple implementation of QuickSort makes two calls to itself and in worst case requires O(n) space on function call stack. The worst case happens when the selecte
    11 min read
    Implement Quicksort with first element as pivot
    QuickSort is a Divide and Conquer algorithm. It picks an element as a pivot and partitions the given array around the pivot. There are many different versions of quickSort that pick the pivot in different ways.  Always pick the first element as a pivot.Always pick the last element as a pivot.Pick a
    13 min read
    Advanced Quick Sort (Hybrid Algorithm)
    Prerequisites: Insertion Sort, Quick Sort, Selection SortIn this article, a Hybrid algorithm with the combination of quick sort and insertion sort is implemented. As the name suggests, the Hybrid algorithm combines more than one algorithm. Why Hybrid algorithm: Quicksort algorithm is efficient if th
    9 min read
    Quick Sort using Multi-threading
    QuickSort is a popular sorting technique based on divide and conquer algorithm. In this technique, an element is chosen as a pivot and the array is partitioned around it. The target of partition is, given an array and an element x of the array as a pivot, put x at its correct position in a sorted ar
    9 min read
    Stable QuickSort
    A sorting algorithm is said to be stable if it maintains the relative order of records in the case of equality of keys.Input : (1, 5), (3, 2) (1, 2) (5, 4) (6, 4) We need to sort key-value pairs in the increasing order of keys of first digit There are two possible solution for the two pairs where th
    9 min read
    Dual pivot Quicksort
    As we know, the single pivot quick sort takes a pivot from one of the ends of the array and partitioning the array, so that all elements are left to the pivot are less than or equal to the pivot, and all elements that are right to the pivot are greater than the pivot.The idea of dual pivot quick sor
    10 min read
    3-Way QuickSort (Dutch National Flag)
    In simple QuickSort algorithm, we select an element as pivot, partition the array around a pivot and recur for subarrays on the left and right of the pivot. Consider an array which has many redundant elements. For example, {1, 4, 2, 4, 2, 4, 1, 2, 4, 1, 2, 2, 2, 2, 4, 1, 4, 4, 4}. If 4 is picked as
    15+ min read

    Visualization of QuickSort

    Sorting Algorithm Visualization : Quick Sort
    An algorithm like Quicksort algorithm is hard to understand theoretically. We can understand easily by visualizing such kind of algorithms. In this article, a program that visualizes the Quicksort Algorithm has been implemented.The Graphical User Interface(GUI) is implemented in python using pygame
    3 min read
    Visualizing Quick Sort using Tkinter in Python
    Prerequisite: QuickSort Tkinter is a very easy-to-use and beginner-friendly GUI library that can be used to visualize the sorting algorithms. Here Quick Sort Algorithm is visualized which is a divide and conquer algorithm. It first considers a pivot element then, creates two subarrays to hold elemen
    7 min read
    Visualization of Quick sort using Matplotlib
    Visualizing algorithms makes it easier to understand them by analyzing and comparing the number of operations that took place to compare and swap the elements. For this we will use matplotlib, to plot bar graphs to represent the elements of the array,   Approach : We will generate an array with rand
    3 min read
    3D Visualisation of Quick Sort using Matplotlib in Python
    Visualizing algorithms makes it easier to understand them by analyzing and comparing the number of operations that took place to compare and swap the elements. 3D visualization of algorithms is less common, for this we will use Matplotlib to plot bar graphs and animate them to represent the elements
    3 min read

    Partitions in QuickSort

    Hoare's vs Lomuto partition scheme in QuickSort
    We have discussed the implementation of QuickSort using Lomuto partition scheme. Lomuto's partition scheme is easy to implement as compared to Hoare scheme. This has inferior performance to Hoare's QuickSort.Lomuto's Partition Scheme:This algorithm works by assuming the pivot element as the last ele
    15+ min read
    Quick Sort(Hoare's Partition) Visualization using JavaScript
    GUI(Graphical User Interface) helps in better understanding than programs. In this article, we will visualize Quick Sort using JavaScript. We will see how the array is being partitioned into two parts and how we get the final sorted array. We will also visualize the time complexity of Quick Sort. Re
    4 min read
    Quick Sort(Lomuto Partition) Visualization using JavaScript
    GUI(Graphical User Interface) helps in better in understanding than programs. In this article, we will visualize Quick Sort using JavaScript. We will see how the array is being partitioned using Lomuto Partition and then how we get the final sorted array. We will also visualize the time complexity o
    4 min read
    Implement Various Types of Partitions in Quick Sort in Java
    Quicksort is a Divide and Conquer Algorithm that is used for sorting the elements. In this algorithm, we choose a pivot and partitions the given array according to the pivot. Quicksort algorithm is a mostly used algorithm because this algorithm is cache-friendly and performs in-place sorting of the
    7 min read

    Some problems on QuickSort

    QuickSort on Singly Linked List
    Given a linked list, apply the Quick sort algorithm to sort the linked list. To sort the Linked list change pointers rather than swapping data.Example:Input: 5->4->1->3->2Output: 1->2->3->4->5Input: 4->3->2->1Output: 1->2->3->4Approach:The Quick Sort algorit
    13 min read
    QuickSort on Doubly Linked List
    Given a doubly linked list, the task is to sort the doubly linked list in non-decreasing order using the quicksort.Examples:Input: head: 5<->3<->4<->1<->2Output: 1<->2<->3<->4<->5Explanation: Doubly Linked List after sorting using quicksort technique i
    12 min read
    Nuts & Bolts Problem (Lock & Key problem) using Quick Sort
    Given a set of n nuts of different sizes and n bolts of different sizes. There is a one-one mapping between nuts and bolts. Match nuts and bolts efficiently. Constraint: Comparison of a nut to another nut or a bolt to another bolt is not allowed. It means a nut can only be compared with a bolt and a
    12 min read
    Is Quick Sort Algorithm Adaptive or not
    Adaptive sorting algorithms are designed to take advantage of existing order in the input data. This means, if the array is already sorted or partially sorted, an adaptive algorithm will recognize that and sort the array faster than it would for a completely random array.Quick Sort is not an adaptiv
    6 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