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
Leetcode-cn.com 2022-05-01
🟡 1305.all-elements-in-two-binary-search-trees
🏷️ Tags
#tree #depth_first_search #binary_search_tree #binary_tree #sorting
Description
给你
Example
🟡 1305.all-elements-in-two-binary-search-trees
🏷️ Tags
#tree #depth_first_search #binary_search_tree #binary_tree #sorting
Description
给你
root1 和 root2 这两棵二叉搜索树。请你返回一个列表,其中包含 两棵树 中的所有整数并按 升序 排序。.Example
输入:root1 = [2,1,4], root2 = [1,0,3]
输出:[0,1,1,2,3,4]