Skip to content

Latest commit

 

History

History

queue_with_stacks

Queue from two stacks

Given a queue with two stack members, implement enqueue and dequeue.

Challenge

Algorithm input consists of a queue data structure with stack members. enqueue takes a value argument. Output from dequeue are the values in FIFO order. Stack has len, pop, and push.

Solution

Whiteboard Images