Search
⌘K

Leetcode 270. Closest Binary Search Tree Value

Given a Binary Search Tree and a target numeric value, return the value of the node in the tree that is closest to the target. Leverage the BST ordering to traverse toward the target and maintain the best candidate (can be done in O(h) time, where h is tree height).

Asked at:

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid November, 2025

Meta

Senior

Early October, 2025

Meta

Staff

Mid July, 2025

Meta

Mid-level

Comments

Your account is free and you can post anonymously if you choose.