CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Suppose a stack implementation supports and instruction REVERSE, while 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 the modified stack?

A
A queue can be implemented where ENQUEUE takes a single instruction and DEQUEUE takes a single instruction and DEQUEUE takes a sequence of two instructions.
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
A queue can be implemented where ENQUEUE take a sequence of there instructions and DEQUEUE takes a single instruction
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
A queue can be implemented where both ENQUEUE and DEQUEUE takes a single instruction each.
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
A queue cannot be implemented using this stack
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B A queue can be implemented where ENQUEUE take a sequence of there instructions and DEQUEUE takes a single instruction
Consider a queue with elements inserted in same order as elements present in queue.



A queue can be implemented where ENQUEUE takes a sequence of there instructions and DEQUEUE takes a single instruction.

flag
Suggest Corrections
thumbs-up
1
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Properties of Addition and Subtraction of Integers
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon