Print BST keys in a given range


Please tell me where i am wrong.

@minal.251298,

https://ide.codingblocks.com/s/222623 Corrected code.

You need not sort the array before construction. Also, you need not pass the entire array at one go, do it element by element. I have commented the mistakes in your code and corrected them.

So a sorted Array would give different BST and unsorted would give different??

@minal.251298,
if you sort the arrays, the order of the elements is lost.

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.