dsa2 min read
Distribute Coins in Binary Tree
Count minimum moves to distribute coins evenly by tracking excess/deficit coins flowing through each edge.
Read →
webcoderspeed.com
1276 articles
Count minimum moves to distribute coins evenly by tracking excess/deficit coins flowing through each edge.
Find the Kth ancestor of any tree node in O(log k) per query using binary lifting (sparse table DP).
Find the maximum path sum in a binary tree where the path can start and end at any node.
Serialize a binary tree to string and back using BFS level-order or DFS preorder with null markers.
Find the maximum sum of any BST subtree within a binary tree using post-order DFS returning subtree metadata.