Join Nostr
2026-10-25 15:08:09 UTC

codementor on Nostr: Question: A binary tree is balanced if, at every node, the heights of the left and ...

Question: A binary tree is balanced if, at every node, the heights of the left and right subtrees differ by at most 1.

Write a check that visits each node only once.

(CtCI 4.4)

Try to answer before you open the reply.

#tg004 · TG-004-Q1