Skip to content

Latest commit

 

History

History
32 lines (17 loc) · 851 Bytes

File metadata and controls

32 lines (17 loc) · 851 Bytes

Challenge Summary : Code Challenge 11 - Queue with stacks

Use Stack data structure to create Queue

Challenge Description

Can use pop, push, and peek. Cant use any queue methods

Approach & Efficiency

Create PseudoQueue class with two properties.

A front which will hold linked list of whats next in queue

A stackedContainer that holds everything that has been added.

If Deque is ever called , it will check if front has anything, and it will take from there first. Otherwise, it will empty stacked container into front, and pop from front.

Big O Space O(n) Big O Time o(n)

Solution

UML