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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:40, davidb1113
You begin your first day of responsibilities by examining the recent is security breach at gearup to get ideas for safeguards you will take. at gearup, criminals accessed the company's improperly-secured wireless system and stole customers' credit card information as well as employee social security numbers. what kind of computer crime did gearup face?
Answers: 3
image
Computers and Technology, 23.06.2019 13:30, powellmj9216
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
image
Computers and Technology, 23.06.2019 23:30, huangjianhe135
The keyboard usually has six rows of keys. which of the following is not one of the key group categories? letter keys number keys control keys graphic keys
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, shonnybenskin8
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
You know the right answer?
Using queues to implement a stack 10 points; individual-only in lecture, we considered two implemen...

Questions in other subjects:

Konu
Social Studies, 14.09.2020 18:01
Konu
Mathematics, 14.09.2020 18:01
Konu
Biology, 14.09.2020 18:01
Konu
French, 14.09.2020 18:01
Konu
English, 14.09.2020 18:01
Konu
Mathematics, 14.09.2020 18:01
Konu
Mathematics, 14.09.2020 18:01
Konu
Social Studies, 14.09.2020 18:01
Konu
Mathematics, 14.09.2020 18:01
Konu
English, 14.09.2020 18:01