Medium

37.96%

Given Linked List Representation of Complete Binary Tree, construct the Binary tree.Your task is to complete the function** convert** which takes two arguments the first being the **head** denoting the head of the linked list and the second argument is **root **denoting the root of the tree to be constructed.

**Note : **The complete binary tree is represented as an linked list in a way where If root node is stored at position i, its left, and right children are stored at position 2*i+1, 2*i+2 respectively.

**Input:**

The first line of input is the no of test cases T. Then T test cases follow . Each test case contains 2 lines. The first line contains an integer N denoting the no of nodes of the linked list . Then in the next line are N space separated Ki values of the linked list .

**Output:**

Output of each test case will be the level order traversal of the the constructed binary tree. You do not have to print it .

**Constraints:**

1<=T<=100

1<=N<=100

1<=Ki <=1000

**Example(To be used only for expected output ) :
Input**

1

5

1 2 3 4 5

1 2 3 4 5