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 Closest Grove

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 Closest Grove.

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

How you win

  1. 1Recognize when Closest BST value matches the clues
  2. 2Keep this true after every move: closest is the best value on the unique root-to-search-position path
  3. 3Reach the result within O(height) time and O(1) space

Rules and pressure

  • Target cost: O(height) time and O(1) space
  • State rule: closest is the best value on the unique root-to-search-position path
Lesson 1 of 3

Choose the best candidate and one BST direction at every path node. Break distance ties toward the smaller value. Lesson questions refer to the original example.

Decide both candidate and direction at every node to understand one-path search.

Your call · With target 3.714 at root 4, which direction remains useful?

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