摘要: Given 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 given sum.Fo... 阅读全文
posted @ 2015-07-31 17:18 amazingzoe 阅读(129) 评论(0) 推荐(0)
摘要: Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le... 阅读全文
posted @ 2015-07-31 15:58 amazingzoe 阅读(135) 评论(0) 推荐(0)
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le... 阅读全文
posted @ 2015-07-31 15:40 amazingzoe 阅读(148) 评论(0) 推荐(0)
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.Analyse: the core idea of this problem is... 阅读全文
posted @ 2015-07-31 11:44 amazingzoe 阅读(175) 评论(0) 推荐(0)
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.Analyse: Using binary search to divide the sorted arr... 阅读全文
posted @ 2015-07-31 10:38 amazingzoe 阅读(172) 评论(0) 推荐(0)