
树
文章平均质量分 69
yanrui92
这个作者很懒,什么都没留下…
展开
-
leetcode-sum root to leaf numbers
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 represents the number 123. Find the tota原创 2015-01-08 11:25:58 · 423 阅读 · 0 评论 -
leetcode-valid binary search tree
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key.Th原创 2015-01-28 03:57:00 · 282 阅读 · 0 评论 -
leetcode-unique binary search tree II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program should return all 5 unique BST's shown below. public class原创 2015-01-28 07:20:44 · 300 阅读 · 0 评论 -
leetcode-binary tree maximum path sum
Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example: Given the below binary tree, public class Solution { int result=Integer.M原创 2015-01-28 09:33:16 · 349 阅读 · 0 评论