Write a main function that creates two stacks of Integer objects and a queue of Integer objects. Store the numbers -1, 15, 23, 44, 4, 99 in the first stack. The top of the stack should store 99.
Trace the following fragment for a Stack s and an empty queue q (type Queue ).
a. What is stored in stack s after the first loop executes? What is stored in queue q after the first loop executes?
b. What is stored in stack s after the second loop executes? What is stored in queue q after the second loop executes?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here