Print BST keys in the given range

sample test case is running but not passing the test case.
Please tell that logic is correct or wrong.

Consider input:
1
10
14 17 7 18 12 5 4 6 21 24
11 17

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

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

You can refer this https://ide.codingblocks.com/s/263010 and try to correct.