|All-time Popular Problems|
|Detect cycle in an undirected graph|
|BFS traversal of graph|
|Two Mirror Trees|
|Delete nodes having greater value on right|
|Find the number of islands|
|Sum of all prime numbers between 1 and N.|
|Determine if Two Trees are Identical|
|Longest Palindrome in a String|
Given a number N, your task is to complete the function which generates all n-bit grey code sequences, a grey code sequence is a sequence such that successive patterns in it differ by one bit.
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains an integer N.
For each test case in print the generated grey code sequences separated by space.
Example(To be used for expected output):
00 01 11 10