Showing Posts From

Binary tree

Advanced Binary Tree & BST

Advanced Binary Tree & BST

Week 22 notes: the harder tree problems, where a node has to report several facts to its parent at once. The return-tuple DFS pattern, lowest common ancestor, path sums, and serialize/deserialize.

Binary Trees: Traversals & DFS / BFS

Binary Trees: Traversals & DFS / BFS

Week 10 notes: binary trees are basically recursion you can draw. The three DFS orders, level-order BFS, and the one move that solves most tree problems.