Find minimum and maximum elements in binary search tree in java

In this post, we will see how to find minimum and maximum elements in binary search tree.

Finding minimum element:

Minimum element is nothing but leftmost node in binary search tree, so traverse left until you get leftmost element.

Finding maximum element:

Maximum element is nothing but rightmost node in binary search tree, so traverse right until you get rightmost element.

Complete java program:

When you run above program, you will get below output:

Add Comment