![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tree
文章平均质量分 78
gunxueqiucjw
这个作者很懒,什么都没留下…
展开
-
leetcode validate binary search tree
一道Easy级别的题目 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than原创 2014-12-23 09:16:54 · 538 阅读 · 0 评论 -
leetcode Unique BST
总结一下这题:碰到这种计数问题应该本能想到用dynamic programming的思路 又正好是关于tree的问题,所以应该先想到左子树的结果与右子树的结果的某种操作,这道题正好应该选择乘法操作 class Solution { public: // DFS method int *lookup; int numTrees(int n) { // re原创 2014-12-23 14:11:35 · 582 阅读 · 0 评论