2016年9月16日

104. Maximum Depth of Binary Tree

摘要: 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 farthest l 阅读全文

posted @ 2016-09-16 18:51 三颗心 阅读(156) 评论(0) 推荐(0) 编辑

92. Reverse Linked List II

摘要: Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2- 阅读全文

posted @ 2016-09-16 15:27 三颗心 阅读(233) 评论(0) 推荐(0) 编辑

2016年9月15日

7. Reverse Integer

摘要: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 主要要考虑溢出处理。 阅读全文

posted @ 2016-09-15 16:16 三颗心 阅读(192) 评论(0) 推荐(0) 编辑

86. Partition List

摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文

posted @ 2016-09-15 15:40 三颗心 阅读(180) 评论(0) 推荐(0) 编辑

2. Add Two Numbers

摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single 阅读全文

posted @ 2016-09-15 15:29 三颗心 阅读(240) 评论(0) 推荐(0) 编辑

55. Jump Game

摘要: 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 maxim 阅读全文

posted @ 2016-09-15 13:37 三颗心 阅读(275) 评论(0) 推荐(0) 编辑

70. Climbing Stairs

摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文

posted @ 2016-09-15 13:24 三颗心 阅读(169) 评论(0) 推荐(0) 编辑

53. Maximum Subarray

摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2, 阅读全文

posted @ 2016-09-15 13:09 三颗心 阅读(220) 评论(0) 推荐(0) 编辑

64. Minimum Path Sum

摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文

posted @ 2016-09-15 12:50 三颗心 阅读(209) 评论(0) 推荐(0) 编辑

122. Best Time to Buy and Sell Stock II

摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文

posted @ 2016-09-15 12:40 三颗心 阅读(196) 评论(0) 推荐(0) 编辑

导航