Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 632 Bytes

File metadata and controls

25 lines (14 loc) · 632 Bytes

Pseudo Queue with Stacks

Implement a Queue class using two stacks

Links

White Board Process

Challenge 11

Approach and Efficiency

We used two stacks. All items get pushed and stored on the first stack. Whenever a dequeu needs to happen, we move everything from the first stack to the second and then pop off. Then to keep the correct order, we pop everything back into the first stack.

Big O:

  • Time: O(n)
  • Space: O(1)

Collaborators

Daniel Dills, Wondwosen Tsige, Prabin Singh, Michael Ryan