上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 29 下一页

binary-tree-postorder-traversal

摘要: /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solut... 阅读全文
posted @ 2017-03-09 14:54 123_123 阅读(112) 评论(0) 推荐(0) 编辑

sum-root-to-leaf-numbers

摘要: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number. An example is the root-to-leaf path1->2->3which re 阅读全文
posted @ 2017-03-09 13:33 123_123 阅读(93) 评论(0) 推荐(0) 编辑

jump-game-ii

摘要: 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 @ 2017-03-09 13:03 123_123 阅读(74) 评论(0) 推荐(0) 编辑

jump-game

摘要: //判断是否能调到结尾。贪心算法。记录每次能跳到的最大距离位置。 阅读全文
posted @ 2017-03-09 11:49 123_123 阅读(88) 评论(0) 推荐(0) 编辑

gas-station

摘要: There are N gas stations along a circular route, where the amount of gas at station i isgas[i]. You have a car with an unlimited gas tank and it costs 阅读全文
posted @ 2017-03-09 11:13 123_123 阅读(109) 评论(0) 推荐(0) 编辑

remove-nth-node-from-end-of-list

摘要: 题目描述 Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. Afte 阅读全文
posted @ 2017-03-09 06:46 123_123 阅读(70) 评论(0) 推荐(0) 编辑

powx-n

摘要: Implement pow(x, n). //考虑一下情况:1.n<0 ;用暴力法会超时,所以这里用递归 阅读全文
posted @ 2017-03-08 17:35 123_123 阅读(110) 评论(0) 推荐(0) 编辑

sqrtx

摘要: Implementint sqrt(int x).Compute and return the square root of x. //给定数字x 求解x的开方。 阅读全文
posted @ 2017-03-08 17:22 123_123 阅读(79) 评论(0) 推荐(0) 编辑

two-sum

摘要: Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two n 阅读全文
posted @ 2017-03-08 16:04 123_123 阅读(104) 评论(0) 推荐(0) 编辑

plus one

摘要: //给定数组,该数组描述一个数字。该数字加1之后返回 阅读全文
posted @ 2017-03-08 14:11 123_123 阅读(73) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 29 下一页