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
  • Practice on BST
  • MCQs on BST
  • BST Tutorial
  • BST Insertion
  • BST Traversals
  • BST Searching
  • BST Deletion
  • Check BST
  • Balance a BST
  • Self-Balancing BST
  • AVL Tree
  • Red-Black Tree
  • Splay Tree
  • BST Application
  • BST Advantage
Open In App
Next Article:
Minimum Possible value of |ai + aj - k| for given array and k.
Next article icon

Leaf nodes from Preorder of a Binary Search Tree

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

Given Preorder traversal of a Binary Search Tree. Then the task is to print leaf nodes of the Binary Search Tree from the given preorder.

Examples: 

Input : preorder[] = {890, 325, 290, 530, 965};
Output : 290 530 965
Explanation: Below is the representation of BST using preorder array.

Leaf-nodes-from-Preorder-of-a-Binary-Search-Tree

Table of Content

  • [Expected Approach – 1] Using Inorder and Preorder – O(nlogn) Time and O(n) Space
  • [Expected Approach – 2] Using Stack – O(n) Time and O(n) Space

[Expected Approach – 1] Using Inorder and Preorder – O(nlogn) Time and O(n) Space

The idea is to find Inorder, then traverse the tree in preorder fashion (using both inorder and preorder traversals) and while traversing store the leaf nodes.

How to traverse in preorder fashion using two arrays representing inorder and preorder traversals? 

  • We iterate the preorder array and for each element find that element in the inorder array. For searching, we can use binary search, since inorder traversal of the binary search tree is always sorted. Now, for each element of preorder array, in binary search, we set the range [l, r]. 
  • And when l == r, the leaf node is found. So, initially, l = 0 and l = n – 1 for first element (i.e root) of preorder array. Now, to search for the element on the left subtree of the root, set l = 0 and r= index of root – 1. Also, for all element of right subtree set l = index of root + 1 and r = n -1. Recursively, follow this, until l == r.

Below is the implementation of this approach:

C++
// C++ program to print leaf node from preorder of // binary search tree using inorder + preorder #include <bits/stdc++.h> using namespace std;  int binarySearch(vector<int>& inorder, int l,                                        int r, int d) {     int mid = (l + r) >> 1;      if (inorder[mid] == d)         return mid;      else if (inorder[mid] > d)         return binarySearch(inorder, l, mid - 1, d);      else         return binarySearch(inorder, mid + 1, r, d); }  // Function to find Leaf Nodes by doing preorder // traversal of tree using preorder and inorder vectors. void leafNodesRec(vector<int>& preorder, vector<int>& inorder,                   int l, int r, int& ind, vector<int>& leaves) {        // If l == r, therefore no right or left subtree.     // So, it must be leaf Node, store it.     if (l == r) {         leaves.push_back(inorder[l]);         ind++;         return;     }      // If array is out of bound, return.     if (l < 0 || l > r || r >= inorder.size())         return;      // Finding the index of preorder element     // in inorder vector using binary search.     int loc = binarySearch(inorder, l, r, preorder[ind]);      ind++;      // Finding on the left subtree.     leafNodesRec(preorder, inorder, l, loc - 1,                                            ind, leaves);      // Finding on the right subtree.     leafNodesRec(preorder, inorder, loc + 1, r,                                           ind, leaves); }  // Finds leaf nodes from given preorder traversal. vector<int> leafNodes(vector<int>& preorder) {     int n = preorder.size();     vector<int> inorder(n);       vector<int> leaves;              // Copy the preorder into another vector.     for (int i = 0; i < n; i++)         inorder[i] = preorder[i];      // Finding the inorder by sorting the vector.     sort(inorder.begin(), inorder.end());      // Point to the index in preorder.     int ind = 0;      // Find the Leaf Nodes.     leafNodesRec(preorder, inorder, 0, n - 1,                                       ind, leaves);     return leaves; }   int main() {        vector<int> preorder = {890, 325, 290, 530, 965};          vector<int> result = leafNodes(preorder);  	for (int val : result) {         cout << val << " ";     }        return 0; } 
Java
// Java program to print leaf nodes from preorder of // binary search tree using inorder + preorder import java.util.ArrayList; import java.util.Collections;  class GfG {      static int binarySearch(ArrayList<Integer> inorder,                                      int l, int r, int d) {         int mid = (l + r) / 2;          if (inorder.get(mid) == d)             return mid;          else if (inorder.get(mid) > d)             return binarySearch(inorder, l, mid - 1, d);          else             return binarySearch(inorder, mid + 1, r, d);     }      // Function to find Leaf Nodes by doing preorder     // traversal of tree using preorder and inorder lists.     static void leafNodesRec(ArrayList<Integer> preorder,                      ArrayList<Integer> inorder,                           int l, int r, int[] ind,                              ArrayList<Integer> leaves) {                // If l == r, therefore no right or left subtree.         // So, it must be leaf Node, store it.         if (l == r) {             leaves.add(inorder.get(l));             ind[0]++;             return;         }          // If array is out of bounds, return.         if (l < 0 || l > r || r >= inorder.size())             return;          // Finding the index of preorder element         // in inorder list using binary search.         int loc = binarySearch(inorder,                                 l, r, preorder.get(ind[0]));                ind[0]++;          // Finding on the left subtree.         leafNodesRec(preorder, inorder, l, loc - 1,                                              ind, leaves);          // Finding on the right subtree.         leafNodesRec(preorder, inorder, loc + 1, r,                                              ind, leaves);     }      // Finds leaf nodes from given preorder traversal.     static ArrayList<Integer>                  leafNodes(ArrayList<Integer> preorder) {                int n = preorder.size();         ArrayList<Integer> inorder = new ArrayList<>(preorder);         ArrayList<Integer> leaves = new ArrayList<>();          // Finding the inorder by sorting the list.         Collections.sort(inorder);          // Point to the index in preorder.         int[] ind = {0};          // Find the Leaf Nodes.         leafNodesRec(preorder, inorder, 0, n - 1,                                          ind, leaves);         return leaves;     }      public static void main(String[] args) {                ArrayList<Integer> preorder = new ArrayList<>();         Collections.addAll(preorder, 890, 325, 290, 530, 965);          ArrayList<Integer> result = leafNodes(preorder);                   for (int val : result) {             System.out.print(val + " ");         }     } } 
Python
# Python program to print leaf nodes from preorder of # binary search tree using inorder + preorder  def binary_search(inorder, l, r, d):     mid = (l + r) // 2      if inorder[mid] == d:         return mid     elif inorder[mid] > d:         return binary_search(inorder, l, mid - 1, d)     else:         return binary_search(inorder, mid + 1, r, d)  # Function to find Leaf Nodes by doing preorder # traversal of tree using preorder and inorder lists. def leaf_nodes_rec(preorder, inorder, l, r, ind, leaves):        # If l == r, therefore no right or left subtree.     # So, it must be leaf Node, store it.     if l == r:         leaves.append(inorder[l])         ind[0] += 1         return      # If array is out of bounds, return.     if l < 0 or l > r or r >= len(inorder):         return      # Finding the index of preorder element in      # inorder list using binary search.     loc = binary_search(inorder, l, r, preorder[ind[0]])      ind[0] += 1      # Finding on the left subtree.     leaf_nodes_rec(preorder, inorder, l, loc - 1, ind, leaves)      # Finding on the right subtree.     leaf_nodes_rec(preorder, inorder, loc + 1, r, ind, leaves)  # Finds leaf nodes from given preorder traversal. def leaf_nodes(preorder):     n = len(preorder)     inorder = sorted(preorder)       leaves = []      # Point to the index in preorder.     ind = [0]      # Find the Leaf Nodes.     leaf_nodes_rec(preorder, inorder, 0, n - 1, ind, leaves)     return leaves       # Hardcoded values for preorder list preorder = [890, 325, 290, 530, 965]  result = leaf_nodes(preorder) for val in result:         print(val, end=" ") 
C#
// C# program to print leaf nodes from preorder of // binary search tree using inorder + preorder using System; using System.Collections.Generic;  class GfG {        static int BinarySearch(List<int> inorder,                                  int l, int r, int d) {         int mid = (l + r) / 2;          if (inorder[mid] == d) {            return mid;         }         else if (inorder[mid] > d) {            return BinarySearch(inorder, l, mid - 1, d);         }             else {            return BinarySearch(inorder, mid + 1, r, d);         }                 }      // Function to find Leaf Nodes by doing preorder     // traversal of tree using preorder and inorder lists.     static void LeafNodesRec(List<int> preorder,                  List<int> inorder, int l, int r,                              int[] ind, List<int> leaves) {                // If l == r, therefore no right or left subtree.         // So, it must be a leaf Node, store it.         if (l == r) {             leaves.Add(inorder[l]);             ind[0]++;             return;         }          // If array is out of bounds, return.         if (l < 0 || l > r || r >= inorder.Count)             return;          // Finding the index of preorder element         // in inorder list using binary search.         int loc = BinarySearch(inorder,                                l, r, preorder[ind[0]]);          ind[0]++;          // Finding on the left subtree.         LeafNodesRec(preorder, inorder, l,                                    loc - 1, ind, leaves);          // Finding on the right subtree.         LeafNodesRec(preorder, inorder, loc + 1,                                       r, ind, leaves);     }      // Finds leaf nodes from given preorder traversal.     static List<int> LeafNodes(List<int> preorder) {         int n = preorder.Count;         List<int> inorder = new List<int>(preorder);         inorder.Sort();          List<int> leaves = new List<int>();          // Point to the index in preorder.         int[] ind = new int[1] { 0 };          // Find the Leaf Nodes.         LeafNodesRec(preorder, inorder, 0,                                    n - 1, ind, leaves);         return leaves;     }      static void Main() {                List<int> preorder            = new List<int> { 890, 325, 290, 530, 965 };          List<int> result = LeafNodes(preorder);         foreach (int val in result) {             Console.Write(val + " ");         }     } } 
JavaScript
// JavaScript program to print leaf nodes from preorder of // binary search tree using inorder + preorder   function binarySearch(inorder, l, r, d) {     const mid = Math.floor((l + r) / 2);      if (inorder[mid] === d) {         return mid;     } else if (inorder[mid] > d) {         return binarySearch(inorder, l, mid - 1, d);     } else {         return binarySearch(inorder, mid + 1, r, d);     } }  // Function to find Leaf Nodes by doing preorder // traversal of tree using preorder and inorder arrays. function leafNodesRec(preorder, inorder, l, r, ind, leaves) {      // If l == r, therefore no right or left subtree.     // So, it must be a leaf Node, store it.     if (l === r) {         leaves.push(inorder[l]);         ind[0]++;         return;     }      // If array is out of bounds, return.     if (l < 0 || l > r || r >= inorder.length) {         return;     }      // Finding the index of preorder element     // in inorder array using binary search.     const loc = binarySearch(inorder, l, r, preorder[ind[0]]);      ind[0]++;      // Finding on the left subtree.     leafNodesRec(preorder, inorder, l, loc - 1, ind, leaves);      // Finding on the right subtree.     leafNodesRec(preorder, inorder, loc + 1, r, ind, leaves); }  // Finds leaf nodes from given preorder traversal. function leafNodes(preorder) {     const n = preorder.length;     const inorder = [...preorder];      inorder.sort((a, b) => a - b);      const leaves = [];                  // Point to the index in preorder.     const ind = [0];      // Find the Leaf Nodes.     leafNodesRec(preorder, inorder, 0, n - 1, ind, leaves);     return leaves; }  const preorder = [890, 325, 290, 530, 965];  const result = leafNodes(preorder); console.log(result.join(' ')); 

Output
290 530 965 

[Expected Approach – 2] Using Stack – O(n) Time and O(n) Space

The idea is to use the property of the Binary Search Tree and stack. Traverse the array using two pointer i and j to the array, initially i = 0 and j = 1. Whenever a[i] > a[j], we can say a[j] is left part of a[i], since preorder traversal follows Node -> Left -> Right. So, we push a[i] into the stack. 

For those points violating the rule, we start to pop element from the stack till a[i] > top element of the stack and break when it doesn’t and print the corresponding jth value.

How does this algorithm work? 
Preorder traversal traverse in the order: Node, Left, Right. 
And we know the left node of any node in BST is always less than the node. So preorder traversal will first traverse from root to leftmost node. Therefore, preorder will be in decreasing order first. Now, after decreasing order, there may be a node that is greater or which breaks the decreasing order. So, there can be a case like this : 

Find-if-there-is-a-triplet-in-a-Balanced-BST-that-adds-to-zero_1


In case 1, 20 is a leaf node whereas in case 2, 20 is not the leaf node. 
So, our problem is how to identify if we have to print 20 as a leaf node or not? 
This is solved using stack. 
While running above algorithm on case 1 and case 2, when i = 2 and j = 3, state of a stack will be the same in both the case: 

Find-if-there-is-a-triplet-in-a-Balanced-BST-that-adds-to-zero-2


So, node 65 will pop 20 and 50 from the stack. This is because 65 is the right child of a node which is before 20. This information we store using the found variable. So, 20 is a leaf node. 
While in case 2, 40 will not able to pop any element from the stack. Because 40 is the right node of a node which is after 20. So, 20 is not a leaf node.
Note: In the algorithm, we will not be able to check the condition of the leaf node of the rightmost node or rightmost element of the preorder. So, simply print the rightmost node because we know this will always be a leaf node in preorder traversal.

Below is the implementation of the approach: 

C++
// C++ program to print leaf nodes from the preorder  // traversal of a Binary Search Tree using a stack #include <iostream> #include <stack> #include <vector>  using namespace std;  // Function to find leaf nodes from the  // preorder traversal vector<int> printLeafNodes(vector<int>& preorder) {     stack<int> s;      vector<int> leaves;     int n = preorder.size();      // Iterate through the preorder vector     for (int i = 0, j = 1; j < n; i++, j++) {         bool found = false;          // Push current node if it's greater than          // the next node         if (preorder[i] > preorder[j]) {             s.push(preorder[i]);         }          else {                        // Pop elements from stack until current node is              // less than or equal to top of stack             while (!s.empty()) {                 if (preorder[j] > s.top()) {                     s.pop();                     found = true;                  }                  else {                     break;                 }             }         }          // If a leaf node is found, add it          // to the leaves vector         if (found) {             leaves.push_back(preorder[i]);         }     }      // Since the rightmost element      // is always a leaf node     leaves.push_back(preorder[n - 1]);      return leaves;  }   int main() {        // Hardcoded values for preorder Array     vector<int> preorder = {890, 325, 290, 530, 965};     vector<int> result = printLeafNodes(preorder);      for (int val : result) {         cout << val << " ";     }      return 0; } 
Java
// Java program to print leaf nodes from the preorder  // traversal of a Binary Search Tree using a stack import java.util.ArrayList; import java.util.Stack; import java.util.Arrays;  class GfG {      // Function to find leaf nodes from the      // preorder traversal     static ArrayList<Integer> printLeafNodes(                          ArrayList<Integer> preorder) {                Stack<Integer> s = new Stack<>();         ArrayList<Integer> leaves = new ArrayList<>();         int n = preorder.size();          // Iterate through the preorder list         for (int i = 0, j = 1; j < n; i++, j++) {             boolean found = false;              // Push current node if it's greater than              // the next node             if (preorder.get(i) > preorder.get(j)) {                 s.push(preorder.get(i));             }              else {                  // Pop elements from stack until current node is                  // less than or equal to top of stack                 while (!s.isEmpty()) {                     if (preorder.get(j) > s.peek()) {                         s.pop();                         found = true;                     }                      else {                         break;                     }                 }             }              // If a leaf node is found, add it              // to the leaves list             if (found) {                 leaves.add(preorder.get(i));             }         }          // Since the rightmost element          // is always a leaf node         leaves.add(preorder.get(n - 1));          return leaves;     }  	 public static void main(String[] args) {                ArrayList<Integer> preorder = new ArrayList<>();         preorder.addAll(Arrays.asList(890, 325, 290, 530, 965));          ArrayList<Integer> result = printLeafNodes(preorder);                 for (int val : result) {             System.out.print(val + " ");         }     } } 
Python
# Python program to print leaf nodes from the preorder  # traversal of a Binary Search Tree using a stack  def print_leaf_nodes(preorder):     s = []      leaves = []       n = len(preorder)      # Iterate through the preorder list     for i in range(n - 1):         found = False          # Push current node if it's greater         # than the next node         if preorder[i] > preorder[i + 1]:             s.append(preorder[i])         else:             # Pop elements from stack until current node is              # less than or equal to top of stack             while s and preorder[i + 1] > s[-1]:                 s.pop()                 found = True          # If a leaf node is found, add it to the         # leaves list         if found:             leaves.append(preorder[i])      # Since the rightmost element is always     # a leaf node     leaves.append(preorder[-1])      return leaves   if __name__ == "__main__":        preorder = [890, 325, 290, 530, 965]      result = print_leaf_nodes(preorder)     print(" ".join(map(str, result))) 
C#
// C# program to print leaf nodes from the preorder // traversal of a Binary Search Tree using a stack using System; using System.Collections.Generic;  class GfG {      // Function to find leaf nodes from the     // preorder traversal     static List<int> PrintLeafNodes(List<int> preorder) {         Stack<int> s = new Stack<int>();         List<int> leaves = new List<int>();         int n = preorder.Count;          // Iterate through the preorder list         for (int i = 0, j = 1; j < n; i++, j++) {             bool found = false;              // Push current node if it's greater than              // the next node             if (preorder[i] > preorder[j]) {                 s.Push(preorder[i]);             }              else {                  // Pop elements from stack until current node is                 // less than or equal to top of stack                 while (s.Count > 0) {                     if (preorder[j] > s.Peek()) {                         s.Pop();                         found = true;                     }                     else {                         break;                     }                 }             }              // If a leaf node is found, add it              // to the leaves list             if (found) {                 leaves.Add(preorder[i]);             }         }          // Since the rightmost element is          // always a leaf node         leaves.Add(preorder[n - 1]);          return leaves;     }      static void Main(string[] args) {         List<int> preorder            = new List<int> { 890, 325, 290, 530, 965 };          List<int> result = PrintLeafNodes(preorder);            foreach (int val in result) {             Console.Write(val + " ");         }     } } 
JavaScript
// JavaScript program to print leaf nodes from the preorder  // traversal of a Binary Search Tree using a stack  function printLeafNodes(preorder) {     let s = [];     let leaves = [];     let n = preorder.length;      // Iterate through the preorder list     for (let i = 0, j = 1; j < n; i++, j++) {         let found = false;          // Push current node if it's greater          // than the next node         if (preorder[i] > preorder[j]) {             s.push(preorder[i]);         }          else {                      // Pop elements from stack until current node is              // less than or equal to top of stack             while (s.length > 0 && preorder[j] > s[s.length - 1]) {                 s.pop();                 found = true;             }         }          // If a leaf node is found, add it to the leaves array         if (found) {             leaves.push(preorder[i]);         }     }      // Since the rightmost element is always a leaf node     leaves.push(preorder[n - 1]);      return leaves; }  function printArray(arr) {     console.log(arr.join(' ')); }  //Hardcoded input for preorder Array let preorder = [890, 325, 290, 530, 965];  let result = printLeafNodes(preorder); printArray(result); 

Output
290 530 965 

Related articles:

  • Leaf nodes from Preorder of a Binary Search Tree (Using Recursion)


Next Article
Minimum Possible value of |ai + aj - k| for given array and k.

A

Anuj Chauhan
Improve
Article Tags :
  • Binary Search Tree
  • DSA
  • Binary Search
Practice Tags :
  • Binary Search
  • Binary Search Tree

Similar Reads

  • Binary Search Tree
    A Binary Search Tree (or BST) is a data structure used in computer science for organizing and storing data in a sorted manner. Each node in a Binary Search Tree has at most two children, a left child and a right child, with the left child containing values less than the parent node and the right chi
    3 min read
  • Introduction to Binary Search Tree
    Binary Search Tree is a data structure used in computer science for organizing and storing data in a sorted manner. Binary search tree follows all properties of binary tree and for every nodes, its left subtree contains values less than the node and the right subtree contains values greater than the
    3 min read
  • Applications of BST
    Binary Search Tree (BST) is a data structure that is commonly used to implement efficient searching, insertion, and deletion operations along with maintaining sorted sequence of data. Please remember the following properties of BSTs before moving forward. The left subtree of a node contains only nod
    2 min read
  • Applications, Advantages and Disadvantages of Binary Search Tree
    A Binary Search Tree (BST) is a data structure used to storing data in a sorted manner. Each node in a Binary Search Tree has at most two children, a left child and a right child, with the left child containing values less than the parent node and the right child containing values greater than the p
    2 min read
  • Insertion in Binary Search Tree (BST)
    Given a BST, the task is to insert a new node in this BST. Example: How to Insert a value in a Binary Search Tree:A new key is always inserted at the leaf by maintaining the property of the binary search tree. We start searching for a key from the root until we hit a leaf node. Once a leaf node is f
    15+ min read
  • Searching in Binary Search Tree (BST)
    Given a BST, the task is to search a node in this BST. For searching a value in BST, consider it as a sorted array. Now we can easily perform search operation in BST using Binary Search Algorithm. Input: Root of the below BST Output: TrueExplanation: 8 is present in the BST as right child of rootInp
    7 min read
  • Deletion in Binary Search Tree (BST)
    Given a BST, the task is to delete a node in this BST, which can be broken down into 3 scenarios: Case 1. Delete a Leaf Node in BST Case 2. Delete a Node with Single Child in BST Deleting a single child node is also simple in BST. Copy the child to the node and delete the node. Case 3. Delete a Node
    10 min read
  • Binary Search Tree (BST) Traversals – Inorder, Preorder, Post Order
    Given a Binary Search Tree, The task is to print the elements in inorder, preorder, and postorder traversal of the Binary Search Tree.  Input:  Output: Inorder Traversal: 10 20 30 100 150 200 300Preorder Traversal: 100 20 10 30 200 150 300Postorder Traversal: 10 30 20 150 300 200 100 Input:  Output:
    11 min read
  • Balance a Binary Search Tree
    Given a BST (Binary Search Tree) that may be unbalanced, the task is to convert it into a balanced BST that has the minimum possible height. Examples: Input: Output: Explanation: The above unbalanced BST is converted to balanced with the minimum possible height. Input: Output: Explanation: The above
    10 min read
  • Self-Balancing Binary Search Trees
    Self-Balancing Binary Search Trees are height-balanced binary search trees that automatically keep the height as small as possible when insertion and deletion operations are performed on the tree. The height is typically maintained in order of logN so that all operations take O(logN) time on average
    4 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