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?

Hey @Shameena_Taj

In a simpler solution we will just import the queue as “import java.util.Queue;”. But in our solution, we are creating queue and all its functions from scratch which you can view on “Queue.java” file in the relevant lesson.

Happy learning,