All Posts

1276 articles

dsa2 min read

Find Leaves of Binary Tree

Collect leaves by height (distance from leaf) repeatedly, returning all leaves at each height level.

Read →
dsa2 min read

Count Complete Tree Nodes

Count nodes in a complete binary tree in O(log^2 n) by comparing left and right heights to identify full subtrees.

Read →
Page 106 of 256