Minimum and Maximum Value in BST

Published by BijogFc24 in

Given a Binary Search Tree (BST) implementation, complete the minimum, and maximum function which is present in the BST class. Here you have to find the max value, min value of the whole tree.

Examples

data = [10, 4 , 20 , 1 , 5]

maximum()  ➞ 20
      10
      /   \
    4    20
  /  \
1    5

data = [100, 70, 200, 34, 80, 300]

minimum() ➞ 34

       100
       /    \
    70    200
  /    \          \
34   80      300

Notes

Maximum and Minimum value of the whole tree.

Watch a quick demo on how Edabit works.