All Posts

1575 articles

dsa3 min read

Kth Ancestor of a Tree Node

Find the Kth ancestor of any tree node in O(log k) per query using binary lifting (sparse table DP).

Read →
dsa2 min read

Maximum Sum BST in Binary Tree

Find the maximum sum of any BST subtree within a binary tree using post-order DFS returning subtree metadata.

Read →
Page 165 of 315