随笔分类 -  LeetCode

上一页 1 ··· 3 4 5 6 7

摘要:引自:http://www.douban.com/note/330562764/注:此分类仅供大概参考,没有精雕细琢。有不同意见欢迎评论~利用堆栈:http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/http://oj.l... 阅读全文

posted @ 2014-10-24 17:46 Yu's Garden 阅读(2178) 评论(1) 推荐(2)

摘要:Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the ... 阅读全文

posted @ 2014-10-24 16:39 Yu's Garden 阅读(948) 评论(0) 推荐(0)

摘要:Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity ... 阅读全文

posted @ 2014-10-24 12:40 Yu's Garden 阅读(2212) 评论(0) 推荐(1)

摘要:Spiral Matrix IIGiven an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should retu... 阅读全文

posted @ 2014-10-24 11:06 Yu's Garden 阅读(950) 评论(0) 推荐(0)

摘要:Set Matrix ZeroesGiven a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did yo... 阅读全文

posted @ 2014-10-24 09:44 Yu's Garden 阅读(576) 评论(0) 推荐(0)

摘要:Spiral MatrixGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following m... 阅读全文

posted @ 2014-10-23 18:39 Yu's Garden 阅读(1788) 评论(0) 推荐(1)

摘要:Word Break IIGiven a string s and a dictionary of words dict, add spaces in s toconstruct a sentence where each word is a valid dictionaryword.Return ... 阅读全文

posted @ 2014-10-23 04:40 Yu's Garden 阅读(9682) 评论(1) 推荐(0)

摘要:Clone GraphClone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes ar... 阅读全文

posted @ 2014-10-22 20:48 Yu's Garden 阅读(951) 评论(0) 推荐(0)

摘要:Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given... 阅读全文

posted @ 2014-10-22 18:06 Yu's Garden 阅读(1161) 评论(0) 推荐(1)

摘要:Populating Next Right Pointers in Each Node IIFollow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any ... 阅读全文

posted @ 2014-10-21 19:20 Yu's Garden 阅读(2726) 评论(0) 推荐(0)

摘要:Populating Next Right Pointers in Each Node TotalGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next... 阅读全文

posted @ 2014-10-21 19:18 Yu's Garden 阅读(1986) 评论(0) 推荐(0)

摘要:Word SearchGiven 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, wh... 阅读全文

posted @ 2014-10-21 15:10 Yu's Garden 阅读(3698) 评论(1) 推荐(0)

摘要:String to Integer (atoi) Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, ... 阅读全文

posted @ 2014-10-21 11:32 Yu's Garden 阅读(725) 评论(0) 推荐(0)

摘要:Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents yo... 阅读全文

posted @ 2014-10-21 11:08 Yu's Garden 阅读(2146) 评论(0) 推荐(0)

摘要:Q:Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0]return 3,and [3,4,-1,1]return 2.Your algorithm sho... 阅读全文

posted @ 2014-10-20 18:45 Yu's Garden 阅读(670) 评论(5) 推荐(0)

摘要:Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes co... 阅读全文

posted @ 2014-10-20 17:52 Yu's Garden 阅读(507) 评论(0) 推荐(0)

摘要:Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example,... 阅读全文

posted @ 2014-10-20 16:51 Yu's Garden 阅读(1832) 评论(2) 推荐(0)

摘要:Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a... 阅读全文

posted @ 2014-10-20 13:50 Yu's Garden 阅读(553) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7

导航