摘要: Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.这题思路参照Conve... 阅读全文
posted @ 2014-11-29 19:05 陆草纯 阅读(385) 评论(0) 推荐(0) 编辑
摘要: Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tre... 阅读全文
posted @ 2014-11-29 16:18 陆草纯 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root... 阅读全文
posted @ 2014-11-29 15:56 陆草纯 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Path Sum IIGiven a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tr... 阅读全文
posted @ 2014-11-29 15:47 陆草纯 阅读(266) 评论(0) 推荐(0) 编辑
摘要: Path SumGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the give... 阅读全文
posted @ 2014-11-29 15:35 陆草纯 阅读(1136) 评论(0) 推荐(0) 编辑
摘要: Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / ... 阅读全文
posted @ 2014-11-29 14:56 陆草纯 阅读(360) 评论(0) 推荐(0) 编辑
摘要: Populating Next Right Pointers in Each Node IIFollow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any ... 阅读全文
posted @ 2014-11-29 11:08 陆草纯 阅读(232) 评论(0) 推荐(0) 编辑