this is my code link, I am not able to find out what’s the problem in this. It’s passed for 1 test case but in other, it’s showing run error.
Build Balanced BST
by sorting we are forming inorder and using it we are forming BST which might be same as given array. then where is the problem in sorting?
@AlphaX you are given an array. Tumhe usse mid point vali tech se bst banana hai sort karke shaayad order change hojaayega . Banega balance bst hi lekin alag hoga tree .
Toh ek baar ye dono cheeze karke dekho chal gaya code ki nahi
code to chal gya, bas ye hi tha ki sort krne pr kya problem h ye hi bta dete
Are sort karke alag bst Banega bina sort kare alag.
Dono mein balanced hoga lekin jo question hai usmein sort nahi bola toh nahi karna.
Ab linklist agar maanlo reverse karni hai 1324 ab sort karke reverse thodhi karoge jaise de rakhi hai usse reverse karni hai
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.