Welcome to the daily solving of our PROBLEM OF THE DAY with Yash Dwivedi. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of BST but also build up problem-solving skills.
In this problem, we are given the root of a Binary Search Tree. The task is to find the minimum valued element in this given BST.
Example :
Input:
5
/ \
4 6
/ \
3 7
/
1
Output: 1
Give the problem a try before going through the video. All the best!!!
Problem Link: https://www.geeksforgeeks.org/problems/minimum-element-in-bst/1
Solution IDE Link: https://ide.geeksforgeeks.org/online-cpp14-compiler/2b60f0af-83ee-4d7f-b088-0ac5b6d5e505