摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.解题思路:根据递增序列,求平衡二叉查找树,根据平衡二叉查找树的性质,其左右都是二叉查找树,用递归可以比较轻... 阅读全文
posted @ 2014-12-29 21:59 ElephantKing 阅读(115) 评论(0) 推荐(0)
摘要: Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1... 阅读全文
posted @ 2014-12-29 21:45 ElephantKing 阅读(102) 评论(0) 推荐(0)