Given a BST and some keys, you need to insert the keys in the given BST. Duplicates are not inserted.

**Input Format:**

The first line of the input contains an integer **'T'** denoting the number of test cases. Then **'T'** test cases follow. Each test case consists of three lines. Description of test cases is as follows:

The First line of each test case contains an integer **'N'** which denotes the no of nodes to be inserted in the BST. .

The Second line of each test case contains **'N'** space separated values of the nodes to be inserted in the BST.

**Output Format:**

For each testcase, in a new line, the inorder of the BST gets printed.

**Your Task:**

Since this is a function problem, you don't have to read anything. You have to **complete the function insert **that takes **node and key **as **parameter**.

**Constraints:**

1 <= T <= 100

1 <= N <= 100

**Example:
Input**

2

7

2 81 87 42 66 90 45

4

6 7 9 8

2 42 45 66 81 87 90

6 7 8 9

Author: Shubham Joshi 1

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

VISHESHA SADU | 27 |

ghanshyam648 | 25 |

Biswajit3 | 21 |

karthik_kasaragadda | 20 |

tanya_sharma | 18 |

KshatriyaYash | 1066 |

nikhil_sojan | 978 |

lonecoder | 935 |

mazumderrohit8 | 864 |

SumitSingh27 | 832 |

blackshadows | 5327 |

Ibrahim Nash | 5215 |

akhayrutdinov | 5111 |

mb1973 | 4468 |

Quandray | 4444 |

Login to report an issue on this page.