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.
πŸ’¬ Discuss
βœ… Correct Answer: (C) a queue can be implemented where enqueue takes a sequence of three instructions and dequeue takes a single instruction.

You must be Logged in to update hint/solution

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
899
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
82%
Success Rate