Find Min and Max Element In Binary Search Tree - BST

preview_player
Показать описание
JOIN ME:

Find the smallest and the largest or find the min and max element from the binary search tree is very basic interview question. Interviewers can ask this questions to freshers or beginners to check if they know the basic properties of the Binary Search Tree or not.

The important point about the BST is that it is already sorted so finding smallest and the largest element in the given BST is very straight that the left most element in BST is the smallest number and the right most number in BST is the largest number, you just have to loop through the left till the end to find the smallest and loop through the right to get to the largest element.

#findminmaxbst #bst #binarysearchtree #datastructure #algorithms #interviewquestions #dsalgo
Рекомендации по теме
Комментарии
Автор

The while solution is much better in my opinion

stoka
Автор

Good for learning recursion basics, but iterative method is better at least at space complexity :)

oimudzp
Автор

May I know which programming language did you use in this video? Is it Python or C??
Please reply fast.. I've some doubts

Learningnewthings
Автор

Can you send me that while loop for right

muraliffworld