Question

Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions.


I'm looking for implementation of queue where ENQUEUE takes a sequence of three instructions and DEQUEUE takes a single instruction , or any better algorithm .

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with cs.stackexchange
scroll top