利用BST的性质不断朝target搜索,直至最底层。记录一路经过的根节点,不断更新 (root->val - target)的最小结果。
注意:result的初始值必须设置为root->val。
GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — LeetCode/Tree/270.Closest-Binary-Search-Tree-Value at master · wisdompeak/LeetCode Expand file tree/ Copy path270.Closest-Binary-Search-Tree-Value/Directory actionsMore optionsMore optionsDirectory actionsMore optionsMore options/ Copy path270.Closest-Binary-Search-Tree-Value/Folders and files
利用BST的性质不断朝target搜索,直至最底层。记录一路经过的根节点,不断更新 (root->val - target)的最小结果。 注意:result的初始值必须设置为root->val。 | |||||||||||||||||||||
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | |||||||||||||||||||||