Largest bst in a bt(not getting testcase passed )
@Saksham12 this code is working fine in many cases. Can you post the link of problem ?
Hint : Try maintaing the preorder index and inorder index seprately by passing it to recursive function.
If you didnt yet pass all test case ping here with question link.
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.
Hey @Saksham12
Please check this out once. https://www.geeksforgeeks.org/find-the-largest-subtree-in-a-tree-that-is-also-a-bst/. You’ll realise the mistake. If you still need help, please mention where you’re facing issues.