Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

- In Lab 5, we experimented with the MM1 simulation, using a Stack instead of a Queue. We held the arrival rate and service rate

image text in transcribedimage text in transcribedimage text in transcribed

- In Lab 5, we experimented with the MM1 simulation, using a Stack instead of a Queue. We held the arrival rate and service rate constant, and only replaced the Queue with a Stack. Which of the following statements about the results was FALSE? A. The minimum time spent waiting was roughly the same in both cases. B. The maximum time spent waiting was larger when using a Stack compared to a Queue. C. The average time spent waiting was larger when using a Stack compared to a Queue. D. Writing the adapter code that allows Stacks and Queues to appear to have the same operations is an example of abstraction. Questions 33-35 refer to the following Python code, using the Stack and Queue ADTS. import TStack as Stack import TQueue as Queue s = Stack.create() 9 = Queue.create() item_list = [1, 2, 3] for item in item_list: Queue.enqueue (q, item) Stack.push(s, item) 13 while not Queue.is_empty(): Stack.push(s, Queue.dequeue (q)) 16 while not Stack.is_empty(s): 17 print (Stack.pop (s), end='') # on one line separated by spaces (1) 33. True or False: After the loop in Lines 9-11, all the items in list item_list have been removed. A. TRUE B. FALSE 34. True or False: After the loop in Lines 16-17, all the items in Stack s have been removed. A. TRUE B. FALSE 35. Which of the following correctly describes the output of the loop in Lines 16-17? A. 1 2 3 1 2 3 B. 3 2 1 3 2 1 C. 3 2 1 1 2 3 D. 1 2 3 3 2 1 E. 3 2 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions