上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 27 下一页
摘要: 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.For example:Given the below binary tree and sum = 22... 阅读全文
posted @ 2017-06-12 23:33 xiejunzhao 阅读(123) 评论(0) 推荐(0)
摘要: You are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.The path does not need to start or end at the root or a leaf, but it must go... 阅读全文
posted @ 2017-06-10 22:22 xiejunzhao 阅读(113) 评论(0) 推荐(0)
摘要: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of this node... 阅读全文
posted @ 2017-06-08 00:07 xiejunzhao 阅读(297) 评论(0) 推荐(0)
摘要: Total Accepted: 2202Total Submissions: 3988Difficulty: EasyContributors:love_FawnYou need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way... 阅读全文
posted @ 2017-06-06 00:15 xiejunzhao 阅读(162) 评论(0) 推荐(0)
摘要: Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings.You need to help them find out their common interest with the le... 阅读全文
posted @ 2017-06-04 23:47 xiejunzhao 阅读(294) 评论(0) 推荐(0)
摘要: Given an m * n matrix M initialized with all 0's and several update operations.Operations are represented by a 2D array, and each operation is represented by an array with two positive integers a and ... 阅读全文
posted @ 2017-05-31 00:10 xiejunzhao 阅读(134) 评论(0) 推荐(0)
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longestpath between any two nodes in a tree. This path may or may no... 阅读全文
posted @ 2017-05-29 00:29 xiejunzhao 阅读(252) 评论(0) 推荐(0)
摘要: You are given a string representing an attendance record for a student. The record only contains the following three characters:'A' : Absent.'L' : Late.'P' : Present.A student could be rewarded if his... 阅读全文
posted @ 2017-05-21 22:22 xiejunzhao 阅读(180) 评论(0) 推荐(0)
摘要: Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.Example:Input: 1 \ 3 / 2 Output: 1 Explanation: The mini... 阅读全文
posted @ 2017-05-19 00:00 xiejunzhao 阅读(364) 评论(0) 推荐(0)
摘要: Given a binary tree, return the tilt of the whole tree.The tilt of a tree node is defined as the absolute difference between the sum of all left subtree node values and the sum of all right subtree no... 阅读全文
posted @ 2017-05-14 01:10 xiejunzhao 阅读(337) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 27 下一页