110. Balanced Binary Tree — bottom-up height(), stepped

Every call returns a subtree height, or -1 meaning "unbalanced somewhere below." Watch each frame's pending 1 + max(▢, ▢) fill in as its children return.

Tree Custom

Speed
depth 0 / max 0 calls 0 / 0 frames on stack 0

Source

Call stack newest on top

Recursion tree

active on the current path returned skipped by short-circuit not called yet

The binary tree itself the recursion tree above is this, plus one leaf per null