Question DSA-QUE-0056
MediumWhich structure can generate binary numbers 1 to n in order (1, 10, 11, 100 …)?
- A.
A queue: dequeue s, output it, enqueue s + '0' and s + '1'
- B.
A min-heap of integers
- C.
Sign up free to see the answer and a step-by-step explanation.