iske build method me int d aur loop k Andar me d kyu hai?
i mean pehle d lene se kya Hoga why can’t we take it inside loop directly.
Bst insertion video
Hi @avinashmallik2017, we can’t take value of d inside loop only because if we had provided input as -1 then the BST would contain one node with -1 value and then exit from the loop but we should have got empty BST for -1 that;s why we first take value of d outside loop then inside
In case of any doubt feel free to ask 
If u got the answer then mark your doubt as resolved
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.