![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode刷题
文章平均质量分 57
沉ing
这个作者很懒,什么都没留下…
展开
-
leetcode 刷题(求树的直径)
树的直径的定义:The diameter of a binary tree is the length of thelongest path between any two nodes in a tree. This path may or may not pass through the root.我首先想到的思路是: 直径必然是两个叶子节点之间的距离的最大值, 怎么求这原创 2017-03-23 10:52:03 · 1452 阅读 · 0 评论 -
leetcode 二叉树--之建BST树
BST(binary search tree)即: 二分搜索树顾名思义, 这种树特别适合二分查找, 因为该树的所有左子树的节点都比根节点的值小, 所有右子树都比根节点的值大。leetcode 108题: Given an array where elements are sorted in ascending order, convert it to a height balanced BST。解原创 2017-03-15 21:53:47 · 561 阅读 · 0 评论