subject

Using queues to implement a stack 10 points; individual-only in lecture, we considered two implementations of the stack adt: one using an array and one using a linked list. devise a third implementation of the stack adt that uses two queues, q1 and q2. use pseudocode to describe how you would use q1 and q2 to implement the stack operations push, pop, and peek, and give the running time of each operation using big-o notation. explain briefly how you came up with the big-o expressions that you use. your algorithms for these methods may use q1, q2, and a constant number of additional variables (either fields of the stack object or local variables of the method). they may not use an array, linked list, orbther data structure. you may assume that the queues support the operations in our queue interface, and that they can store an arbitrary number of objects of any type.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:10
Which are not examples of chronic or persistent stress? moving
Answers: 1
question
Computers and Technology, 22.06.2019 16:00
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 3
question
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
Answers: 2
question
Computers and Technology, 24.06.2019 11:00
In three to five sentences, describe how you can organize written information logically and sequentially
Answers: 1
You know the right answer?
Using queues to implement a stack 10 points; individual-only in lecture, we considered two implemen...
Questions
question
Mathematics, 25.07.2019 20:30
question
Chemistry, 25.07.2019 20:30
Questions on the website: 13722363