divide and conquer
文章平均质量分 74
透明蜗牛
这个作者很懒,什么都没留下…
展开
-
272. Closest Binary Search Tree Value II
272. Closest Binary Search Tree Value IIDescriptionIdeaCodebrute-forceDFSsearch on treeNotesDescriptionGiven the root of a binary search tree, a target value, and an integer k, return the k values in the BST that are closest to the target. You may return原创 2022-05-01 08:34:11 · 97 阅读 · 0 评论 -
98. Validate Binary Search Tree
98. Validate Binary Search TreeDescriptionIdeaCodecode 1code 2NotesDescriptionGiven the root of a binary tree, determine if it is a valid binary search tree (BST).A valid BST is defined as follows:The left subtree of a node contains only nodes with key原创 2022-04-27 14:17:49 · 506 阅读 · 0 评论 -
236. Lowest Common Ancestor of a Binary Tree
236. Lowest Common Ancestor of a Binary TreeDescriptionIdeaCodeNotesDescriptionGiven a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defi原创 2022-04-26 14:44:25 · 126 阅读 · 0 评论