Given a Binary Search Tree. The task is to find the sum and product of maximum and minimum value of tree.
For the above tree, sum and product of maximum and minimum value of tree is 26 and 88 respectively.
- For the node with minimum value: Find the leftmost leaf node
- For the node with maximum value: Find the rightmost leaf node
Below is the implementation of the above approach:
Sum of Maximum value and Minimum value in BST is 7 Product of Maximum value and Minimum value in BST is 6
- Sum and Product of maximum and minimum element in Binary Tree
- Minimum swap required to convert binary tree to binary search tree
- Sum and Product of minimum and maximum element of an Array
- Find the closest element in Binary Search Tree
- Find the node with minimum value in a Binary Search Tree
- Find the node with maximum value in a Binary Search Tree
- Find maximum level product in Binary Tree
- Find the closest element in Binary Search Tree | Space Efficient Method
- Find maximum (or minimum) in Binary Tree
- Minimum and maximum node that lies in the path connecting two nodes in a Binary Tree
- Complexity of different operations in Binary tree, Binary Search Tree and AVL tree
- Binary Search Tree | Set 1 (Search and Insertion)
- Count the Number of Binary Search Trees present in a Binary Tree
- Binary Tree to Binary Search Tree Conversion
- Binary Tree to Binary Search Tree Conversion using STL set
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.
Improved By : SHUBHAMSINGH10