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**

3

7

2 81 87 42 66 90 45

4

6 7 9 8

4

1 1 2 1

2 42 45 66 81 87 90

6 7 8 9

1 2

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.

d_Coder00 | 134 |

dungeon_master1299 | 126 |

Astikeysingh | 120 |

rajendrashekhawat063 | 115 |

kaustavbhattachaarya | 111 |

Pulkit__Sharma__ | 646 |

Anirban166 | 531 |

abducodes | 501 |

Found_me | 454 |

Yo_Nehru | 404 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4559 |

Login to report an issue on this page.