Form a balanced bst and print in preorder problem

Please point out error in given code:

@vidit.103 in print() function, base case has a typing error. check line 27 there should be == you used the assignment operator (=) by mistake

still it is not passing test cases.
Pls rewrite code if there are logical errors.

@vidit.103 try this https://ide.codingblocks.com/s/291034 (print ans for each test case in a new line)

Thanks! It works fine now.

1 Like

@vidit.103 dont forget to mark your doubt as resolved! happy learning :slight_smile:

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.