Search for question
Question

Question 1: Given that you don't have any other data structures (array or linked list) for queue implementation: Discuss how to implement queue data structure using stack. 2, How many

stacks are needed to implement a queue? 3. Given the Stack Interface and the Linked Stack classes, write a Java code to create queue using stack. Test your code by creating a queue Number that takes N numbers to enqueue and then dequeue and print them the numbers on the screen. 4. What is the complexity of queue implementation using stack. 5. Is it possible to implement the stack data structure using queue? Justify youranswer.

Fig: 1

Fig: 2

Fig: 3

Fig: 4

Fig: 5

Fig: 6