摘要: 题目: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transac 阅读全文
posted @ 2016-06-24 10:13 panini 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. 链接: http://leetcode.com/problems/pascals 阅读全文
posted @ 2016-06-24 09:28 panini 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题目: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1 阅读全文
posted @ 2016-06-23 11:38 panini 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 su 阅读全文
posted @ 2016-06-23 10:51 panini 阅读(118) 评论(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 neare 阅读全文
posted @ 2016-06-21 11:04 panini 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2016-06-21 10:47 panini 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). 阅读全文
posted @ 2016-06-19 00:54 panini 阅读(110) 评论(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 farthe 阅读全文
posted @ 2016-06-19 00:00 panini 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tre 阅读全文
posted @ 2016-06-17 10:59 panini 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: 1 / \ 2 阅读全文
posted @ 2016-06-17 10:39 panini 阅读(107) 评论(0) 推荐(0) 编辑