随笔分类 -  LeetCode

上一页 1 ··· 57 58 59 60 61
摘要: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 dep 阅读全文
posted @ 2014-10-23 13:59 Grandyang 阅读(18218) 评论(7) 推荐(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 nearest l 阅读全文
posted @ 2014-10-22 07:27 Grandyang 阅读(19057) 评论(5) 推荐(3)
摘要: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 @ 2014-10-22 06:45 Grandyang 阅读(19157) 评论(6) 推荐(1)
摘要:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). F 阅读全文
posted @ 2014-10-21 15:15 Grandyang 阅读(11355) 评论(4) 推荐(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 sum. N 阅读全文
posted @ 2014-10-20 13:08 Grandyang 阅读(18127) 评论(4) 推荐(0)
摘要:Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become: [ 阅读全文
posted @ 2014-10-18 13:05 Grandyang 阅读(17153) 评论(14) 推荐(1)
摘要:Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers 阅读全文
posted @ 2014-10-18 04:17 Grandyang 阅读(9984) 评论(2) 推荐(2)
摘要:Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note that the row index starts from 0. In Pascal's trian 阅读全文
posted @ 2014-10-17 16:52 Grandyang 阅读(12937) 评论(2) 推荐(0)
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Pa 阅读全文
posted @ 2014-10-17 04:09 Grandyang 阅读(21873) 评论(5) 推荐(3)
摘要:Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: E 阅读全文
posted @ 2014-10-16 14:24 Grandyang 阅读(27419) 评论(4) 推荐(2)

上一页 1 ··· 57 58 59 60 61
Fork me on GitHub