上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 43 下一页

2015年10月4日

96. Unique Binary Search Trees (Tree; DP)

摘要: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 unique BST 阅读全文

posted @ 2015-10-04 11:49 joannae 阅读(209) 评论(0) 推荐(0) 编辑

110. Balanced Binary Tree (Tree; DFS)

摘要: Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth... 阅读全文

posted @ 2015-10-04 11:38 joannae 阅读(155) 评论(0) 推荐(0) 编辑

104. Maximum Depth of Binary Tree (Tree; DFS)

摘要: 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-10-04 11:35 joannae 阅读(176) 评论(0) 推荐(0) 编辑

111. Minimum Depth of Binary Tree (Tree; DFS)

摘要: 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-10-04 11:34 joannae 阅读(210) 评论(0) 推荐(0) 编辑

124. Binary Tree Maximum Path Sum (Tree; DFS)

摘要: Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in th 阅读全文

posted @ 2015-10-04 11:17 joannae 阅读(222) 评论(0) 推荐(0) 编辑

99. Recover Binary Search Tree (Tree; DFS)

摘要: Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note: A solution using O(n) space 阅读全文

posted @ 2015-10-04 10:35 joannae 阅读(175) 评论(0) 推荐(0) 编辑

129. Sum Root to Leaf Numbers(Tree; DFS)

摘要: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which... 阅读全文

posted @ 2015-10-04 10:22 joannae 阅读(152) 评论(0) 推荐(0) 编辑

113. Path Sum II (Tree; DFS)

摘要: Given 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 tree and sum ... 阅读全文

posted @ 2015-10-04 10:20 joannae 阅读(178) 评论(0) 推荐(0) 编辑

112. Path Sum (Tree; DFS)

摘要: 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-10-04 10:18 joannae 阅读(144) 评论(0) 推荐(0) 编辑

150. Evaluate Reverse Polish Notation (Stack)

摘要: Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another ex... 阅读全文

posted @ 2015-10-04 10:11 joannae 阅读(154) 评论(0) 推荐(0) 编辑

上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 43 下一页

导航