Implement a stack that supports push and pop operations using standard enqueue and dequeue operations of the queue.
Implement a queue using a single linked list. (Hint: Enqueuing happens at the tail of the list, and the dequeuing of items happens at the head of the list.)
Given a positive number n, efficiently generate binary numbers between 1 and n using the queue data structure in linear time.
Example:
Input:
n = 10
Output :
1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 10000