随笔分类 -  leetcode刷题总结

上一页 1 ··· 3 4 5 6 7 8 9 下一页
https://oj.leetcode.com/
摘要:Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2... 阅读全文
posted @ 2014-07-06 00:09 SunshineAtNoon 阅读(531) 评论(0) 推荐(0) 编辑
摘要:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2014-07-04 21:06 SunshineAtNoon 阅读(190) 评论(0) 推荐(0) 编辑
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?判断一... 阅读全文
posted @ 2014-07-04 20:03 SunshineAtNoon 阅读(415) 评论(0) 推荐(1) 编辑
摘要:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l... 阅读全文
posted @ 2014-06-19 22:11 SunshineAtNoon 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo... 阅读全文
posted @ 2014-06-19 21:50 SunshineAtNoon 阅读(153) 评论(0) 推荐(0) 编辑
摘要:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point ... 阅读全文
posted @ 2014-06-19 21:34 SunshineAtNoon 阅读(184) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].题解... 阅读全文
posted @ 2014-06-11 10:18 SunshineAtNoon 阅读(144) 评论(0) 推荐(0) 编辑
摘要:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
posted @ 2014-06-10 20:01 SunshineAtNoon 阅读(311) 评论(0) 推荐(0) 编辑
摘要:Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2014-06-10 17:18 SunshineAtNoon 阅读(313) 评论(0) 推荐(0) 编辑
摘要:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]... 阅读全文
posted @ 2014-06-10 16:24 SunshineAtNoon 阅读(152) 评论(0) 推荐(0) 编辑
摘要:The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number... 阅读全文
posted @ 2014-06-10 11:22 SunshineAtNoon 阅读(168) 评论(0) 推荐(0) 编辑
摘要:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal... 阅读全文
posted @ 2014-06-10 10:53 SunshineAtNoon 阅读(160) 评论(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 / \ ... 阅读全文
posted @ 2014-06-09 23:40 SunshineAtNoon 阅读(150) 评论(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 depth... 阅读全文
posted @ 2014-06-09 21:00 SunshineAtNoon 阅读(174) 评论(0) 推荐(0) 编辑
摘要:You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb... 阅读全文
posted @ 2014-06-09 20:58 SunshineAtNoon 阅读(183) 评论(0) 推荐(0) 编辑
摘要:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.水题不解释,一A,... 阅读全文
posted @ 2014-06-09 20:39 SunshineAtNoon 阅读(159) 评论(0) 推荐(0) 编辑
摘要:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... 阅读全文
posted @ 2014-06-09 20:30 SunshineAtNoon 阅读(187) 评论(0) 推荐(0) 编辑
摘要: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,1,... 阅读全文
posted @ 2014-06-09 19:41 SunshineAtNoon 阅读(134) 评论(0) 推荐(0) 编辑
摘要:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a... 阅读全文
posted @ 2014-05-20 20:11 SunshineAtNoon 阅读(172) 评论(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 @ 2014-05-19 20:30 SunshineAtNoon 阅读(199) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 下一页
点击右上角即可分享
微信分享提示