educative.io

Educative

Generate Binary Numbers from 1 to n using Queue

Can i have a simpler solution for the generation of binary numbers using a queue or explanation for the given solution why it should be done this way only?