Given a binary tree, invert it.
Tree Inversion means that the left child becomes the right child and vice versa. This happens recursively for the subtrees.
The first line contains an integer T denoting the number of test cases.
For each test case, the input has 2 lines:
For each test case, the output has a line containing the level order traversal of the tree.
5
12
1 2 3 4 5 6 -1 -1 -1 7 -1 8
7
1 2 -1 4 -1 5 6
7
8 -1 9 -1 10 11 12
5
28 14 11 -1 48
1
6
1 3 2 6 5 4 8 7
1 2 4 6 5
8 9 10 12 11
28 11 14 48
6
1 <= T <= 10
1 <= n <= 105
1 <= node value <= 104