Skip to content
playdsa
Preferences

Make yourself comfortable.

Saved on this browser. Your device’s reduced-motion preference is always respected.

Theme
Advanced settings

The Recursive Height

Learn
Play
Prove
Problem context and objectives
Mission briefing

Archive pathfinder · Clues branch through a living archive

Explore only the branches that can still contain the answer: The Recursive Height.

Ignoring the parent-child rule turns a focused search into a full maze traversal.

How you win

  1. 1Recognize when Maximum tree depth by DFS matches the clues
  2. 2Keep this true after every move: depth(node) equals the number of nodes on the longest downward path beginning at node
  3. 3Reach the result within O(n) time and O(height) call space

Rules and pressure

  • Target cost: O(n) time and O(height) call space
  • State rule: depth(node) equals the number of nodes on the longest downward path beginning at node
Lesson 1 of 3

Predict the depth, then follow the returning child results. Null preserves missing child slots. Lesson questions refer to the original tree.

Each call returns the depth of its own subtree.

Your call · The root receives left=1 and right=2. What should it return?

Help shape PlayDSA

Something confusing, broken, or missing? Leave a quick note without leaving your lesson.

Please leave out passwords, payment details and other private information.

Page included: /

Sign in to save feedback here, or send it with your email app. Your draft stays here while you sign in.

Open email instead