Q.

Suppose implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack?

A. a queue cannot be implemented using this stack.
B. a queue can be implemented where enqueue takes a single instruction and dequeue takes a sequence of two instructions.
C. a queue can be implemented where enqueue takes a sequence of three instructions and dequeue takes a single instruction.
D. a queue can be implemented where both enqueue and dequeue take a single instruction each.
Answer» C. a queue can be implemented where enqueue takes a sequence of three instructions and dequeue takes a single instruction.
2.4k
0
Do you find this helpful?
24

View all MCQs in

Data Structures (DS)

Discussion

No comments yet

Related MCQs