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 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:
Find the Deepest Node in a Binary Tree
Next article icon

Closest leaf to a given node in Binary Tree

Last Updated : 11 Jun, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

Given a Binary Tree and a node x in it, find distance of the closest leaf to x in Binary Tree. If given node itself is a leaf, then distance is 0.
Examples: 
 

Input: Root of below tree        And x = pointer to node 13           10        /     \      12       13              /                 14       Output 1 Distance 1. Closest leaf is 14.   Input: Root of below tree        And x = pointer to node 13           10        /     \      12       13            /     \          14       15             /   \     /  \        21   22   23   24        /\   /\   /\   /\       1 2  3 4  5 6  7  8  Output 2 Closest leaf is 12 through 10.

We strongly recommend you to minimize your browser and try this yourself first. 
The idea is to first traverse the subtree rooted with give node and find the closest leaf in this subtree. Store this distance. Now traverse tree starting from root. If given node x is in left subtree of root, then find the closest leaf in right subtree, else find the closest left in left subtree. Below is the implementation of this idea. 
 

C++




/* Find closest leaf to the given node x in a tree */
#include<bits/stdc++.h>
using namespace std;
 
// A Tree node
struct Node
{
    int key;
    struct Node* left, *right;
};
 
// Utility function to create a new node
Node* newNode(int key)
{
    Node* temp = new Node;
    temp->key = key;
    temp->left = temp->right = NULL;
    return (temp);
}
 
// This function finds closest leaf to root.  This distance
// is stored at *minDist.
void findLeafDown(Node *root, int lev, int *minDist)
{
    // base case
    if (root == NULL)
        return ;
 
    // If this is a leaf node, then check if it is closer
    // than the closest so far
    if (root->left == NULL && root->right == NULL)
    {
        if (lev < (*minDist))
            *minDist = lev;
        return;
    }
 
    // Recur for left and right subtrees
    findLeafDown(root->left, lev+1, minDist);
    findLeafDown(root->right, lev+1, minDist);
}
 
// This function finds if there is closer leaf to x through
// parent node.
int findThroughParent(Node * root, Node *x, int *minDist)
{
    // Base cases
    if (root == NULL) return -1;
    if (root == x) return 0;
 
    // Search x in left subtree of root
    int l = findThroughParent(root->left, x,  minDist);
 
    // If left subtree has x
    if (l != -1)
    {
        // Find closest leaf in right subtree
        findLeafDown(root->right, l+2, minDist);
        return l+1;
    }
 
    // Search x in right subtree of root
    int r = findThroughParent(root->right, x, minDist);
 
    // If right subtree has x
    if (r != -1)
    {
        // Find closest leaf in left subtree
        findLeafDown(root->left, r+2, minDist);
        return r+1;
    }
 
    return -1;
}
 
// Returns minimum distance of a leaf from given node x
int minimumDistance(Node *root, Node *x)
{
    // Initialize result (minimum distance from a leaf)
    int minDist = INT_MAX;
 
    // Find closest leaf down to x
    findLeafDown(x, 0, &minDist);
 
    // See if there is a closer leaf through parent
    findThroughParent(root, x, &minDist);
 
    return minDist;
}
 
// Driver program
int main ()
{
    // Let us create Binary Tree shown in above example
    Node *root  = newNode(1);
    root->left  = newNode(12);
    root->right = newNode(13);
 
    root->right->left   = newNode(14);
    root->right->right  = newNode(15);
 
    root->right->left->left   = newNode(21);
    root->right->left->right  = newNode(22);
    root->right->right->left  = newNode(23);
    root->right->right->right = newNode(24);
 
    root->right->left->left->left  = newNode(1);
    root->right->left->left->right = newNode(2);
    root->right->left->right->left  = newNode(3);
    root->right->left->right->right = newNode(4);
    root->right->right->left->left  = newNode(5);
    root->right->right->left->right = newNode(6);
    root->right->right->right->left = newNode(7);
    root->right->right->right->right = newNode(8);
 
    Node *x = root->right;
 
    cout << "The closest leaf to the node with value "
         << x->key << " is at a distance of "
         << minimumDistance(root, x) << endl;
 
    return 0;
}
 
 

Java




// Java program to find closest leaf to given node x in a tree
  
// A binary tree node
class Node
{
    int key;
    Node left, right;
  
    public Node(int key)
    {
        this.key = key;
        left = right = null;
    }
}
  
class Distance
{
    int minDis = Integer.MAX_VALUE;
}
  
class BinaryTree
{
    Node root;
  
    // This function finds closest leaf to root.  This distance
    // is stored at *minDist.
    void findLeafDown(Node root, int lev, Distance minDist)
    {
          
        // base case
        if (root == null)
            return;
  
        // If this is a leaf node, then check if it is closer
        // than the closest so far
        if (root.left == null && root.right == null)
        {
            if (lev < (minDist.minDis))
                minDist.minDis = lev;
              
            return;
        }
  
        // Recur for left and right subtrees
        findLeafDown(root.left, lev + 1, minDist);
        findLeafDown(root.right, lev + 1, minDist);
    }
  
    // This function finds if there is closer leaf to x through
    // parent node.
    int findThroughParent(Node root, Node x, Distance minDist)
    {
        // Base cases
        if (root == null)
            return -1;
          
        if (root == x)
            return 0;
          
        // Search x in left subtree of root
        int l = findThroughParent(root.left, x, minDist);
  
        // If left subtree has x
        if (l != -1)
        {   
            // Find closest leaf in right subtree
            findLeafDown(root.right, l + 2, minDist);
            return l + 1;
        }
  
        // Search x in right subtree of root
        int r = findThroughParent(root.right, x, minDist);
  
        // If right subtree has x
        if (r != -1)
        {
            // Find closest leaf in left subtree
            findLeafDown(root.left, r + 2, minDist);
            return r + 1;
        }
  
        return -1;
    }
  
    // Returns minimum distance of a leaf from given node x
    int minimumDistance(Node root, Node x)
    {
        // Initialize result (minimum distance from a leaf)
        Distance d = new Distance();
  
        // Find closest leaf down to x
        findLeafDown(x, 0, d);
  
        // See if there is a closer leaf through parent
        findThroughParent(root, x, d);
  
        return d.minDis;
    }
  
    // Driver program
    public static void main(String[] args)
    {
        BinaryTree tree = new BinaryTree();
          
        // Let us create Binary Tree shown in above example
        tree.root = new Node(1);
        tree.root.left = new Node(12);
        tree.root.right = new Node(13);
  
        tree.root.right.left = new Node(14);
        tree.root.right.right = new Node(15);
  
        tree.root.right.left.left = new Node(21);
        tree.root.right.left.right = new Node(22);
        tree.root.right.right.left = new Node(23);
        tree.root.right.right.right = new Node(24);
  
        tree.root.right.left.left.left = new Node(1);
        tree.root.right.left.left.right = new Node(2);
        tree.root.right.left.right.left = new Node(3);
        tree.root.right.left.right.right = new Node(4);
        tree.root.right.right.left.left = new Node(5);
        tree.root.right.right.left.right = new Node(6);
        tree.root.right.right.right.left = new Node(7);
        tree.root.right.right.right.right = new Node(8);
  
        Node x = tree.root.right;
  
        System.out.println("The closest leaf to node with value "
                + x.key + " is at a distance of "
                + tree.minimumDistance(tree.root, x));
    }
}
  
// This code has been contributed by mayank_24
 
 

Python3




# Find closest leaf to the given
# node x in a tree
 
# Utility class to create a new node
class newNode:
    def __init__(self, key):
        self.key = key
        self.left = self.right = None
     
# This function finds closest leaf to
# root. This distance is stored at *minDist.
def findLeafDown(root, lev, minDist):
     
    # base case
    if (root == None):
        return
 
    # If this is a leaf node, then check if
    # it is closer than the closest so far
    if (root.left == None and
        root.right == None):
        if (lev < (minDist[0])):
            minDist[0] = lev
        return
 
    # Recur for left and right subtrees
    findLeafDown(root.left, lev + 1, minDist)
    findLeafDown(root.right, lev + 1, minDist)
 
# This function finds if there is
# closer leaf to x through parent node.
def findThroughParent(root, x, minDist):
     
    # Base cases
    if (root == None):
        return -1
    if (root == x):
        return 0
 
    # Search x in left subtree of root
    l = findThroughParent(root.left, x,
                               minDist)
 
    # If left subtree has x
    if (l != -1):
         
        # Find closest leaf in right subtree
        findLeafDown(root.right, l + 2, minDist)
        return l + 1
 
    # Search x in right subtree of root
    r = findThroughParent(root.right, x, minDist)
 
    # If right subtree has x
    if (r != -1):
         
        # Find closest leaf in left subtree
        findLeafDown(root.left, r + 2, minDist)
        return r + 1
 
    return -1
 
# Returns minimum distance of a leaf
# from given node x
def minimumDistance(root, x):
     
    # Initialize result (minimum
    # distance from a leaf)
    minDist = [999999999999]
 
    # Find closest leaf down to x
    findLeafDown(x, 0, minDist)
 
    # See if there is a closer leaf
    # through parent
    findThroughParent(root, x, minDist)
 
    return minDist[0]
 
# Driver Code
if __name__ == '__main__':
     
    # Let us create Binary Tree shown
    # in above example
    root = newNode(1)
    root.left = newNode(12)
    root.right = newNode(13)
 
    root.right.left = newNode(14)
    root.right.right = newNode(15)
 
    root.right.left.left = newNode(21)
    root.right.left.right = newNode(22)
    root.right.right.left = newNode(23)
    root.right.right.right = newNode(24)
 
    root.right.left.left.left = newNode(1)
    root.right.left.left.right = newNode(2)
    root.right.left.right.left = newNode(3)
    root.right.left.right.right = newNode(4)
    root.right.right.left.left = newNode(5)
    root.right.right.left.right = newNode(6)
    root.right.right.right.left = newNode(7)
    root.right.right.right.right = newNode(8)
 
    x = root.right
 
    print("The closest leaf to the node with value",
           x.key, "is at a distance of",
           minimumDistance(root, x))
 
# This code is contributed by PranchalK
 
 

C#




using System;
 
// C# program to find closest leaf to given node x in a tree
 
// A binary tree node
public class Node
{
    public int key;
    public Node left, right;
 
    public Node(int key)
    {
        this.key = key;
        left = right = null;
    }
}
 
public class Distance
{
    public int minDis = int.MaxValue;
}
 
public class BinaryTree
{
    public Node root;
 
    // This function finds closest leaf to root.  This distance
    // is stored at *minDist.
    public virtual void findLeafDown(Node root, int lev, Distance minDist)
    {
 
        // base case
        if (root == null)
        {
            return;
        }
 
        // If this is a leaf node, then check if it is closer
        // than the closest so far
        if (root.left == null && root.right == null)
        {
            if (lev < (minDist.minDis))
            {
                minDist.minDis = lev;
            }
 
            return;
        }
 
        // Recur for left and right subtrees
        findLeafDown(root.left, lev + 1, minDist);
        findLeafDown(root.right, lev + 1, minDist);
    }
 
    // This function finds if there is closer leaf to x through 
    // parent node.
    public virtual int findThroughParent(Node root, Node x, Distance minDist)
    {
        // Base cases
        if (root == null)
        {
            return -1;
        }
 
        if (root == x)
        {
            return 0;
        }
 
        // Search x in left subtree of root
        int l = findThroughParent(root.left, x, minDist);
 
        // If left subtree has x
        if (l != -1)
        {
            // Find closest leaf in right subtree
            findLeafDown(root.right, l + 2, minDist);
            return l + 1;
        }
 
        // Search x in right subtree of root
        int r = findThroughParent(root.right, x, minDist);
 
        // If right subtree has x
        if (r != -1)
        {
            // Find closest leaf in left subtree
            findLeafDown(root.left, r + 2, minDist);
            return r + 1;
        }
 
        return -1;
    }
 
    // Returns minimum distance of a leaf from given node x
    public virtual int minimumDistance(Node root, Node x)
    {
        // Initialize result (minimum distance from a leaf)
        Distance d = new Distance();
 
        // Find closest leaf down to x
        findLeafDown(x, 0, d);
 
        // See if there is a closer leaf through parent
        findThroughParent(root, x, d);
 
        return d.minDis;
    }
 
    // Driver program
    public static void Main(string[] args)
    {
        BinaryTree tree = new BinaryTree();
 
        // Let us create Binary Tree shown in above example
        tree.root = new Node(1);
        tree.root.left = new Node(12);
        tree.root.right = new Node(13);
 
        tree.root.right.left = new Node(14);
        tree.root.right.right = new Node(15);
 
        tree.root.right.left.left = new Node(21);
        tree.root.right.left.right = new Node(22);
        tree.root.right.right.left = new Node(23);
        tree.root.right.right.right = new Node(24);
 
        tree.root.right.left.left.left = new Node(1);
        tree.root.right.left.left.right = new Node(2);
        tree.root.right.left.right.left = new Node(3);
        tree.root.right.left.right.right = new Node(4);
        tree.root.right.right.left.left = new Node(5);
        tree.root.right.right.left.right = new Node(6);
        tree.root.right.right.right.left = new Node(7);
        tree.root.right.right.right.right = new Node(8);
 
        Node x = tree.root.right;
 
        Console.WriteLine("The closest leaf to node with value " + x.key + " is at a distance of " + tree.minimumDistance(tree.root, x));
    }
}
 
 //  This code is contributed by Shrikant13
 
 

Javascript




<script>
// javascript program to find closest leaf to given node x in a tree
 
// A binary tree node
class Node {
    constructor(key) {
        this.key = key;
        this.left = this.right = null;
    }
}
 
class Distance {
constructor(){
    this.minDis = Number.MAX_VALUE;
    }
}
 
 
    var root;
 
    // This function finds closest leaf to root. This distance
    // is stored at *minDist.
    function findLeafDown( root , lev,  minDist) {
 
        // base case
        if (root == null)
            return;
 
        // If this is a leaf node, then check if it is closer
        // than the closest so far
        if (root.left == null && root.right == null) {
            if (lev < (minDist.minDis))
                minDist.minDis = lev;
 
            return;
        }
 
        // Recur for left and right subtrees
        findLeafDown(root.left, lev + 1, minDist);
        findLeafDown(root.right, lev + 1, minDist);
    }
 
    // This function finds if there is closer leaf to x through
    // parent node.
    function findThroughParent( root,  x,  minDist) {
        // Base cases
        if (root == null)
            return -1;
 
        if (root == x)
            return 0;
 
        // Search x in left subtree of root
        var l = findThroughParent(root.left, x, minDist);
 
        // If left subtree has x
        if (l != -1) {
            // Find closest leaf in right subtree
            findLeafDown(root.right, l + 2, minDist);
            return l + 1;
        }
 
        // Search x in right subtree of root
        var r = findThroughParent(root.right, x, minDist);
 
        // If right subtree has x
        if (r != -1) {
            // Find closest leaf in left subtree
            findLeafDown(root.left, r + 2, minDist);
            return r + 1;
        }
 
        return -1;
    }
 
    // Returns minimum distance of a leaf from given node x
    function minimumDistance( root,  x) {
        // Initialize result (minimum distance from a leaf)
         d = new Distance();
 
        // Find closest leaf down to x
        findLeafDown(x, 0, d);
 
        // See if there is a closer leaf through parent
        findThroughParent(root, x, d);
 
        return d.minDis;
    }
 
    // Driver program
     
     
 
        // Let us create Binary Tree shown in above example
        root = new Node(1);
        root.left = new Node(12);
        root.right = new Node(13);
 
        root.right.left = new Node(14);
        root.right.right = new Node(15);
 
        root.right.left.left = new Node(21);
        root.right.left.right = new Node(22);
        root.right.right.left = new Node(23);
        root.right.right.right = new Node(24);
 
        root.right.left.left.left = new Node(1);
        root.right.left.left.right = new Node(2);
        root.right.left.right.left = new Node(3);
        root.right.left.right.right = new Node(4);
        root.right.right.left.left = new Node(5);
        root.right.right.left.right = new Node(6);
        root.right.right.right.left = new Node(7);
        root.right.right.right.right = new Node(8);
 
        x = root.right;
 
        document.write("The closest leaf to node with value "
        + x.key + " is at a distance of "
                + minimumDistance(root, x));
 
// This code contributed by umadevi9616
</script>
 
 

Output: 

The closest leaf to the node with value 13 is at a distance of 2

Time Complexity: O(n) as it does at most two traversals of given Binary Tree.

Auxiliary Space: O(n) using call stack for recursion

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
 



Next Article
Find the Deepest Node in a Binary Tree

E

Ekta Goel
Improve
Article Tags :
  • DSA
  • Tree
Practice Tags :
  • Tree

Similar Reads

  • Find the closest leaf in a Binary Tree
    Given a Binary Tree and a key 'k', find distance of the closest leaf from 'k'. Examples: A / \ B C / \ E F / \ G H / \ / I J K Closest leaf to 'H' is 'K', so distance is 1 for 'H' Closest leaf to 'C' is 'B', so distance is 2 for 'C' Closest leaf to 'E' is either 'I' or 'J', so distance is 2 for 'E'
    14 min read
  • Print cousins of a given node in Binary Tree
    Given a binary tree and a node, print all cousins of given node. Note that siblings should not be printed.Example: Input : root of below tree 1 / \ 2 3 / \ / \ 4 5 6 7 and pointer to a node say 5. Output : 6, 7 The idea to first find level of given node using the approach discussed here. Once we hav
    15+ min read
  • Delete the last leaf node in a Binary Tree
    Given a Binary Tree, the task is to find and DELETE the last leaf node.The leaf node is a node with no children. The last leaf node would be the node that is traversed last in sequence during Level Order Traversal. The problem statement is to identify this last visited node and delete this particula
    15+ min read
  • Sum of cousins of a given node in a Binary Tree
    Given a binary tree and data value of a node. The task is to find the sum of cousin nodes of given node. If given node has no cousins then return -1. Note: It is given that all nodes have distinct values and the given node exists in the tree. Examples: Input: 1 / \ 3 7 / \ / \ 6 5 4 13 / / \ 10 17 1
    11 min read
  • Find the Deepest Node in a Binary Tree
    Given a binary tree, find the deep­est node in it. Examples: Input : Root of below tree 1 / \ 2 3 / \ / \ 4 5 6 7 \ 8 Output : 8 Input : Root of below tree 1 / \ 2 3 / 6 Output : 6 Method 1: The idea is to do Inorder traversal of a given binary tree. While doing Inorder traversal, we pass level of c
    15+ min read
  • Deepest left leaf node in a binary tree
    Given a Binary Tree, find the deepest leaf node that is left child of its parent. For example, consider the following tree. The deepest left leaf node is the node with value 9. 1 / \ 2 3 / / \ 4 5 6 \ \ 7 8 / \ 9 10 The idea is to recursively traverse the given binary tree and while traversing, main
    13 min read
  • Find mirror of a given node in Binary tree
    Given a Binary tree, the problem is to find the mirror of a given node. The mirror of a node is a node which exists at the mirror position of the node in opposite subtree at the root. Examples: In above tree- Node 2 and 3 are mirror nodes Node 4 and 6 are mirror nodes. Recommended PracticeMirror of
    15+ min read
  • Find K smallest leaf nodes from a given Binary Tree
    Given a binary tree and an integer K, the task is to find the K smallest leaf nodes from the given binary tree. The number of leaf nodes will always be at least K. Examples: Input: 1 / \ 2 3 / \ / \ 4 5 6 7 / \ \ 21 8 19Output: 6 8 19Explanation:There are 4 leaf nodes in the above binary tree out of
    7 min read
  • Level of a Node in Binary Tree
    Given a Binary Tree and a key, the task is to find the level of key in the Binary Tree. Examples: Input : key = 4 Output: 3Explanation: The level of the key in above binary tree is 3.Input : key = 10 Output: -1Explanation: Key is not present in the above Binary tree. Table of Content [Expected Appro
    12 min read
  • Find distance from root to given node in a binary tree
    Given the root of a binary tree and a key x in it, find the distance of the given key from the root. Dis­tance means the num­ber of edges between two nodes. Examples: Input: x = 45 Output: 3 Explanation: There are three edges on path from root to 45.For more understanding of question, in above tree
    11 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

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