# Find minimum and maximum elements in binary search tree in java

If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions.

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:

import_contacts

## Related Posts

• 20 February

### Inorder Successor in a Binary Search Tree

Table of ContentsProblemSolutionAPPROACH – I :Approach – II:(i) If the target node has a right child :(ii) If the target node does not have a right child :Time Complexity Discussion If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this post, we will see how to […]

• 10 October

### Convert sorted Linked List to balanced BST

If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. In this post , we will see how to convert sorted LinkedList to balanced binary search tree. There are two ways to do it. Solution 1: It is very much similar to convert sorted array to BST. […]

• 10 October

### Convert sorted array to balanced binary search tree

Table of ContentsAlgorithm:Java code to convert sorted array to balanced binary search tree: If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. In this post ,  we will see how to convert sorted array to balanced binary search tree. Algorithm: You might know that inorder traversal of […]

• 16 September

### Check if a binary tree is binary search tree or not in java

Table of ContentsFirst method:Second Method:Complete java program to check if Binary tree is binary search tree or not. If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. In this post, we will see how to check if given binary tree is binary search tree or not. […]

• 16 April

### Delete a node from binary search tree in java

If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. In this post, we will see how to delete a node from binary search tree. There are two parts to it. Search the node After searching that node, delete the node. There are three cases which we […]

• 15 April

### Binary search tree in java

Table of ContentsSearch()Insert() If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. Binary search tree is a special type of binary tree which have following properties. Nodes which are smaller than root will be in left subtree. Nodes which are greater than root will be right […]

## Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.