摘要:
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文
posted @ 2015-12-14 14:31
ZHOU YANG
阅读(183)评论(0)推荐(0)
摘要:
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 the... 阅读全文
posted @ 2015-12-13 19:14
ZHOU YANG
阅读(266)评论(0)推荐(0)
摘要:
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 andsum =... 阅读全文
posted @ 2015-12-13 17:21
ZHOU YANG
阅读(558)评论(0)推荐(0)
摘要:
Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m... 阅读全文
posted @ 2015-12-13 16:35
ZHOU YANG
阅读(173)评论(0)推荐(0)
摘要:
Givennballoons, indexed from0ton-1. Each balloon is painted with a number on it represented by arraynums. You are asked to burst all the balloons. If ... 阅读全文
posted @ 2015-12-13 16:12
ZHOU YANG
阅读(458)评论(0)推荐(0)
摘要:
Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.Subscribeto se... 阅读全文
posted @ 2015-12-13 14:42
ZHOU YANG
阅读(205)评论(0)推荐(0)
摘要:
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowest ... 阅读全文
posted @ 2015-12-12 16:30
ZHOU YANG
阅读(239)评论(0)推荐(0)
摘要:
Write a program to find the nthsuper ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime listprimesof s... 阅读全文
posted @ 2015-12-12 15:19
ZHOU YANG
阅读(1301)评论(0)推荐(0)
摘要:
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord... 阅读全文
posted @ 2015-12-11 16:24
ZHOU YANG
阅读(195)评论(0)推荐(0)