Given a Binary Search Tree, the task is to find the node with maximum value.
Approach: Just traverse the node from root to right recursively until right is NULL. The node whose right is NULL is the node with the maximum value.
Below is the implementation of the above approach:
Time Complexity: O(n), worst case happens for right skewed trees.
- Find the node with minimum value in a Binary Search Tree using recursion
- Find the node with maximum value in a Binary Search Tree
- Find the node with minimum value in a Binary Search Tree
- Find maximum and minimum element in binary tree without using recursion or stack or queue
- Find the maximum node at a given level in a binary tree
- Leaf nodes from Preorder of a Binary Search Tree (Using Recursion)
- Search a node in Binary Tree
- Insert a node in Binary Search Tree Iteratively
- Postorder predecessor of a Node in Binary Search Tree
- Get maximum left node in binary tree
- Maximum difference between node and its ancestor in Binary Tree
- Sum and Product of minimum and maximum element of Binary Search Tree
- Minimum and maximum node that lies in the path connecting two nodes in a Binary Tree
- Find mirror of a given node in Binary tree
- Find the Deepest Node in a Binary Tree
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.