摘要: 题目: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. 阅读全文
posted @ 2015-04-19 12:37 YRB 阅读(531) 评论(0) 推荐(0)
摘要: 题目: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up:Can you solve it without using extra spa 阅读全文
posted @ 2015-04-19 11:23 YRB 阅读(502) 评论(0) 推荐(0)
摘要: 题目: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 链接: http://leetcode.com/problems/lin 阅读全文
posted @ 2015-04-19 11:22 YRB 阅读(899) 评论(0) 推荐(0)
摘要: 题目:Given a stringsand a dictionary of wordsdict, add spaces insto construct a sentence where each word is a valid dictionary word.Return all such poss... 阅读全文
posted @ 2015-04-19 11:21 YRB 阅读(1677) 评论(0) 推荐(0)
摘要: 题目: Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. 阅读全文
posted @ 2015-04-19 11:19 YRB 阅读(1541) 评论(1) 推荐(0)
摘要: 题目:A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep co... 阅读全文
posted @ 2015-04-19 11:18 YRB 阅读(448) 评论(1) 推荐(0)
摘要: 题目: Given an array of integers, every element appears three times except for one. Find that single one. Note:Your algorithm should have a linear runti 阅读全文
posted @ 2015-04-19 11:15 YRB 阅读(526) 评论(0) 推荐(0)
摘要: 题目: Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime com 阅读全文
posted @ 2015-04-19 11:07 YRB 阅读(235) 评论(0) 推荐(0)
摘要: 题目: There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the followin 阅读全文
posted @ 2015-04-19 11:05 YRB 阅读(399) 评论(0) 推荐(0)
摘要: 题目: There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it 阅读全文
posted @ 2015-04-19 11:03 YRB 阅读(437) 评论(0) 推荐(0)
摘要: 题目: Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are lab 阅读全文
posted @ 2015-04-19 11:01 YRB 阅读(1277) 评论(0) 推荐(0)
摘要: 题目:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ... 阅读全文
posted @ 2015-04-19 10:56 YRB 阅读(844) 评论(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 ex 阅读全文
posted @ 2015-04-19 10:55 YRB 阅读(1255) 评论(1) 推荐(0)
摘要: 题目: Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrou 阅读全文
posted @ 2015-04-19 10:53 YRB 阅读(536) 评论(0) 推荐(0)
摘要: 题目: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 阅读全文
posted @ 2015-04-19 10:43 YRB 阅读(763) 评论(0) 推荐(0)
摘要: 题目: Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,Given [100, 4, 200, 1, 3, 2],The lo 阅读全文
posted @ 2015-04-19 10:42 YRB 阅读(369) 评论(0) 推荐(0)
摘要: 题目: Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWo 阅读全文
posted @ 2015-04-19 00:39 YRB 阅读(2066) 评论(2) 推荐(0)
摘要: 题目:Given two words (beginWordandendWord), and a dictionary's word list, find all shortest transformation sequence(s) frombeginWordtoendWord, such that... 阅读全文
posted @ 2015-04-19 00:37 YRB 阅读(828) 评论(0) 推荐(0)
摘要: 题目: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: 阅读全文
posted @ 2015-04-19 00:34 YRB 阅读(425) 评论(0) 推荐(0)
摘要: 题目:Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in ... 阅读全文
posted @ 2015-04-19 00:33 YRB 阅读(923) 评论(0) 推荐(0)
摘要: 题目: 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 co 阅读全文
posted @ 2015-04-19 00:28 YRB 阅读(773) 评论(0) 推荐(0)
摘要: 题目: 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 co 阅读全文
posted @ 2015-04-19 00:27 YRB 阅读(365) 评论(0) 推荐(0)
摘要: 题目: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transac 阅读全文
posted @ 2015-04-19 00:14 YRB 阅读(396) 评论(0) 推荐(0)
摘要: 题目: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given th 阅读全文
posted @ 2015-04-19 00:13 YRB 阅读(409) 评论(0) 推荐(0)
摘要: 题目: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. 链接: http://leetcode.com/problems/pascals 阅读全文
posted @ 2015-04-19 00:11 YRB 阅读(455) 评论(0) 推荐(0)
摘要: 题目: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1 阅读全文
posted @ 2015-04-19 00:10 YRB 阅读(628) 评论(0) 推荐(0)