Showing Posts From

Bst

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 Search Trees: Order, Search & Balance

Binary Search Trees: Order, Search & Balance

Week 11 notes: a BST keeps values ordered so search, insert, and delete are O(h). The invariant, why inorder comes out sorted, and why balance is everything.