BST; Keys in given range

https://ide.codingblocks.com/s/254128, why wrong answer?

for i/p
10
14 17 7 18 12 5 4 6 21 24
11 17
ur o/p

Preorder : 12 5 4 6 7 18 14 17 21 24

Nodes within range are : 6 12 14 17

the nodes in range are wrong please make proper changes

can refer to this code

EVEN YOUR CODE IS WRONG

i/p 1 14 17 7 18 12 5 4 6 21 24 11 17 o/p# Preorder : 17 7 5 4 6 12 11 17 17 17 17 18 21 24 # Nodes within range are :

This code works perfectly fine!

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.