Getting wrong answer

Firstly here in constraints it says t>1 && t<100
and code runs for t==1, how is this possible??

Secondly question says preorder or inorder traversal ??

Here is the link to my code:

Hi @Ekram,
First, the constraints are only for reference and you to analyze time complexity.
Your remove function is correct.
Actually the nodes have to be added to tree in the order in which they are given. So, you have to write a function addNode, which will create your tree by adding nodes at their correct position in the BST. Also, is it mentioned in the question print preorder traversal of the tree not inorder

Sir add function has been made.

Sir add function has been made
the display function is giving me ans as:
3-> 5 <-7
2-> 3 <-4
-> 2 <-
-> 4 <-
6-> 7 <-8
-> 6 <-
-> 8 <-
But now I am getting answer as 4 6 7 8 instead of 4 7 6 8 as required

@Ekram please share your code