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.

thanuvinu94 | 425 |

the_coder95 | 380 |

RishabhTanwar1 | 280 |

shubham3174 | 208 |

RitikRosan | 202 |

the_coder95 | 1226 |

RishabhTanwar1 | 1000 |

thanuvinu94 | 634 |

tathagat289 | 628 |

themanhasnoname | 620 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4885 |

Quandray | 4547 |

Login to report an issue on this page.