随笔分类 -  leedcode

上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页
摘要:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].Note... 阅读全文
posted @ 2015-07-16 17:19 ~每天进步一点点~ 阅读(105) 评论(0) 推荐(0)
摘要:Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["255.2... 阅读全文
posted @ 2015-07-16 16:49 ~每天进步一点点~ 阅读(173) 评论(0) 推荐(0)
摘要:Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No... 阅读全文
posted @ 2015-07-16 15:59 ~每天进步一点点~ 阅读(153) 评论(0) 推荐(0)
摘要:A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta... 阅读全文
posted @ 2015-07-16 15:07 ~每天进步一点点~ 阅读(236) 评论(0) 推荐(0)
摘要:Given a collection of integers that might contain duplicates,nums, return all possible subsets.Note:Elements in a subset must be in non-descending ord... 阅读全文
posted @ 2015-07-16 12:33 ~每天进步一点点~ 阅读(198) 评论(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 @ 2015-07-16 12:04 ~每天进步一点点~ 阅读(158) 评论(0) 推荐(0)
摘要:Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that is great... 阅读全文
posted @ 2015-07-16 11:42 ~每天进步一点点~ 阅读(116) 评论(0) 推荐(0)
摘要:Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation... 阅读全文
posted @ 2015-07-15 23:53 ~每天进步一点点~ 阅读(258) 评论(0) 推荐(0)
摘要:Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi... 阅读全文
posted @ 2015-07-15 22:27 ~每天进步一点点~ 阅读(224) 评论(1) 推荐(0)
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.public class Solution { public... 阅读全文
posted @ 2015-07-15 21:06 ~每天进步一点点~ 阅读(180) 评论(0) 推荐(0)
摘要:Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog... 阅读全文
posted @ 2015-07-15 19:55 ~每天进步一点点~ 阅读(136) 评论(0) 推荐(0)
摘要:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-... 阅读全文
posted @ 2015-07-15 16:31 ~每天进步一点点~ 阅读(185) 评论(0) 推荐(0)
摘要:Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2015-07-15 12:03 ~每天进步一点点~ 阅读(129) 评论(0) 推荐(0)
摘要:Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to... 阅读全文
posted @ 2015-07-15 11:34 ~每天进步一点点~ 阅读(134) 评论(0) 推荐(0)
摘要:Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted arraynums=[1,1,1,2,2,3],Your function should re... 阅读全文
posted @ 2015-07-14 23:13 ~每天进步一点点~ 阅读(108) 评论(0) 推荐(0)
摘要:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace... 阅读全文
posted @ 2015-07-14 22:37 ~每天进步一点点~ 阅读(168) 评论(0) 推荐(0)
摘要:Given a set of distinct integers,nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not... 阅读全文
posted @ 2015-07-14 21:29 ~每天进步一点点~ 阅读(151) 评论(0) 推荐(0)
摘要:Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],... 阅读全文
posted @ 2015-07-14 19:23 ~每天进步一点点~ 阅读(138) 评论(0) 推荐(0)
摘要:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADOBECODEBA... 阅读全文
posted @ 2015-07-14 19:10 ~每天进步一点点~ 阅读(143) 评论(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 @ 2015-07-14 18:08 ~每天进步一点点~ 阅读(108) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页