183. Generate Binary Numbers
Print the binary representations of 1 through n, in order, without
converting any number to binary.
Instead, build each one from an earlier one. Starting from 1, appending a 0 and
appending a 1 produces the next two binary numbers in sequence, and a queue hands them
back in exactly the right order.
This is breadth-first generation, and it is the same shape as the graph search at the end of this topic.
Constraints - `1 ≤ n ≤ 100000`
Input
A single line containing one integer n.
Output
Print n binary strings on ONE line, separated by single spaces, the representations of 1, 2, ..., n in order, with no leading zeros.
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.