tvl-depot/scratch/facebook
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
..
hard Re-implement suffix_tree function 2020-11-19 21:12:36 +00:00
interview-cake Implement a queue using two stacks 2020-11-21 16:15:43 +00:00
moderate Solve "find pairs for sum" 2020-11-16 17:12:05 +00:00
parsing Document subset of BNF for regex engine 2020-11-13 16:55:39 +00:00
recursion-and-dynamic-programming Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
anglocize-int.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
balanced-binary-tree.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
breakfast-generator.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
bst-checker.py Refactor existing bst-checker implementation 2020-11-21 14:14:50 +00:00
cafe-order-checker.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
cake_thief.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
camping-knapsack.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
coin.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
count-islands.py Solve "count islands" problem 2020-11-20 21:32:22 +00:00
delete-node.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
dijkstras.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
edit-distance.py Implement the Levenstein "edit distance" algorithm 2020-11-20 21:59:18 +00:00
evaluator.hs Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
evaluator.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
find-duplicate-beast-mode.py Solve "find duplicate" using a graph 2020-11-21 13:35:05 +00:00
find-duplicate-optimize-for-space.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
find-rotation-point.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
find-unique-int-among-duplicates.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
graph-coloring.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
heap.py Partially implement a Heap 2020-11-14 14:08:58 +00:00
highest-product-of-3.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
infix-to-postfix.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
inflight-entertainment.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
intersecting-linked-lists.py Find the intersection (if any) between two linked lists 2020-11-15 17:42:44 +00:00
knapsack-faq.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
kth-to-last-node-in-singly-linked-list.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
language.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
language2.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
largest-contiguous-sum.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
largest-stack.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
linked-list-cycles.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
linked_list.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
london-knapsack.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
longest-common-substring.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
merge-sorted-arrays.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
merging-ranges.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
mesh-message.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
move-zeroes-to-end.py Add another solution to the "move zeroes to end" problem 2020-11-16 17:13:03 +00:00
mst.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
n-queens.py Solve N queens 2020-11-13 16:56:02 +00:00
nearby-words.py Solve "nearby words" function 2020-11-16 17:17:28 +00:00
node.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
nth-fibonacci.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
onsite.txt Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
permutation-palindrome.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
polynomial-rolling-hash.py Prefer mutative variant of delete for HashTable 2020-11-16 17:13:39 +00:00
product-of-all-other-numbers.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
queue-two-stacks.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
rabin-karp.py Implement the Rabin Karp string matching algorithm 2020-11-16 17:14:08 +00:00
recursive-string-permutations.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
reverse-linked-list.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
reverse-string-in-place.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
reverse-words.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
scratch.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
second-largest-item-in-bst.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
shuffle.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
stack.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
stacking-boxes.py Solve box-stacking problem 2020-11-13 16:57:47 +00:00
stock-price.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
todo.org Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
top-scores.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
topo-sort.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
traversals.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
utils.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
word-cloud.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00