Leetcode-cn.com 2022-03-21
🟢 653.two-sum-iv-input-is-a-bst
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_search_tree #hash_table #two_pointers #binary_tree
Description
给定一个二叉搜索树
Example
🟢 653.two-sum-iv-input-is-a-bst
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_search_tree #hash_table #two_pointers #binary_tree
Description
给定一个二叉搜索树
root 和一个目标结果 k,如果 BST 中存在两个元素且它们的和等于给定的目标结果,则返回 true。Example
输入: root = [5,3,6,2,4,null,7], k = 9
输出: true