geeksforgeeks
search icon
  • Courses
    Sale
  • Tutorials
  • Interview Prep
    Videos
    June 02, 2022 |2.3K Views

    Number of nodes greater than a given value in n-ary tree

    Tree, Tree, n-ary-tree
     Save  Share   Like
    Description
    Discussion

    The idea is maintain a count variable initialize to 0. Traverse the tree and compare root data with x. If root data is greater than x, increment the count variable and recursively call for all its children.

    Number of nodes greater than a given value in n-ary tree: https://www.geeksforgeeks.org/number-nodes-greater-given-value-n-ary-tree/

     

    Recommendations
    Video Thumbnail
    07:41
    Video Thumbnail
    11.3K Views | 10/01/2025...
    Maximum width of a binary tree
    Video Thumbnail
    08:25
    Video Thumbnail
    4.2K Views | 10/01/2025...
    Print nodes at k distance from root
    Video Thumbnail
    01:06
    Video Thumbnail
    24.4K Views | 10/01/2025...
    Inorder Successor in Binary Search Tree
    Video Thumbnail
    16:28
    Video Thumbnail
    27.1K Views | 10/01/2025...
    Lowest Common Ancestor in a Binary Search Tree
    Video Thumbnail
    04:46
    Video Thumbnail
    9.2K Views | 10/01/2025...
    Root to leaf path sum equal to a given number
    Video Thumbnail
    11:50
    Video Thumbnail
    5.7K Views | 10/01/2025...
    Print BST keys in the given range
    Video Thumbnail
    13:09
    Video Thumbnail
    510.1K Views | 10/01/2025...
    AVL Tree Data Structure
    Video Thumbnail
    50:01
    Video Thumbnail
    31.7K Views | 10/01/2025...
    AVL Tree - Deletion
    Video Thumbnail
    21:39
    Video Thumbnail
    170.7K Views | 09/01/2025...
    Introduction of Segment Tree
    Video Thumbnail
    09:44
    Video Thumbnail
    12.6K Views | 09/01/2025...
    Reverse Level Order Traversal
    GeeksforGeeks
    location
    Corporate & Communications Address:
    A-143, 6th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
    location
    Registered Address:
    K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
    GFG App on Play StoreGFG App on App Store
    • Company
    • About Us
    • Legal
    • Privacy Policy
    • Contact Us
    • Advertise with us
    • GFG Corporate Solution
    • Campus Training Program
    • Explore
    • POTD
    • Job-A-Thon
    • Blogs
    • Nation Skill Up
    • Tutorials
    • Programming Languages
    • DSA
    • Web Technology
    • AI, ML & Data Science
    • DevOps
    • CS Core Subjects
    • Interview Preparation
    • Software and Tools
    • Courses
    • ML and Data Science
    • DSA and Placements
    • Web Development
    • Programming Languages
    • DevOps & Cloud
    • GATE
    • Trending Technologies
    • Videos
    • DSA
    • Python
    • Java
    • C++
    • Web Development
    • Data Science
    • CS Subjects
    • Preparation Corner
    • Interview Corner
    • Aptitude
    • Puzzles
    • GfG 160
    • System Design
    @GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved