Errror in the code

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

ur answer

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

Nodes within range are : 6 12 14 17

the nodes in the range are not correct

also after each test case add a new line character