Question: 1.The text's link-based queue is being used and holds an empty queue. We can say: A.at this point in time an invocation of the enqueue

1.The text's link-based queue is being used and holds an empty queue. We can say:

A.at this point in time an invocation of the enqueue method would throw an exception.

B.at this point in time an invocation of the dequeue method would throw an exception.

C.the value of front is -1.

D.the numElements variable is null.

E.All of these are correct.

2.A glass queue is like a queue but:

A.it uses priorities.

B.it allows enqueuing and dequeuing from both front and rear.

C.it keeps its elements sorted.

D.it allows peeking at front and rear elements.

E.None of these is correct.

3.Queues are useful in situations where:

A.elements must be processed immediately.

B.we must deal with postponed obligations.

C.items are processed in the order they are encountered.

D.sorting is required.

E.None of these is correct.

4. Assume you are using the text's array-based queue and have just instantiated a queue of capacity 10. You enqueue 5 elements and then dequeue 2 elements. Which indices of the internal array elements hold the remaining elements?

A.0 to 2

B.1 to 3

C.2 to 4

D..0 to 4

E.7 to 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!