tvl-depot/scratch/facebook/interview-cake
William Carroll 60d7ea5b91 Implement a queue using two stacks
The space cost is O(n). The runtime cost of enqueue is O(1); the runtime cost of
dequeue is O(n). Using the "accounting method", the cost of an item in the
system is O(1). Here's why:

+------------+----------------------------+------+
| enqueue    | push onto lhs              | O(1) |
+------------+----------------------------+------+
| lhs -> rhs | pop off lhs; push onto rhs | O(1) |
+------------+----------------------------+------+
| dequeue    | pop off rhs                | O(1) |
+------------+----------------------------+------+
2020-11-21 16:15:43 +00:00
..
bst-checker.py Reimplement bst-checker 2020-11-21 14:21:05 +00:00
linked-list-cycles.py Solve "linked-list-cycles" 2020-11-21 14:47:18 +00:00
merge-sorted-arrays.py Solve merge-sorted-arrays (again) 2020-11-21 13:41:33 +00:00
nth-fibonacci.py Implement a bottom-up fibonacci 2020-11-21 14:48:12 +00:00
queue-two-stacks.py Implement a queue using two stacks 2020-11-21 16:15:43 +00:00