270. Closest Binary Search Tree Value

Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.

Note:

Given target value is a floating point.

You are guaranteed to have only one unique value in the BST that is closest to the target.

神奇的递归。


270. Closest Binary Search Tree Value_第1张图片

你可能感兴趣的:(270. Closest Binary Search Tree Value)