- 博客(19)
- 资源 (1)
- 收藏
- 关注
原创 Surrounded Regions-leetcode
题目: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 surrounded region.For example,X X X
2014-05-28 09:51:46 622
原创 leetcode题目:Sum Root to Leaf Numbers和Longest Consecutive Sequence
题目一: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 which represents the number 123.Fin
2014-05-23 15:19:35 812
原创 leetcode题目:Palindrome Partitioning 和Palindrome Partitioning II
题目一: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, given s = "aab",Return [
2014-05-13 16:57:28 702
原创 leetcode题目:Clone Graph
题目: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 labeled uniquely.We use # as a separat
2014-05-09 15:19:08 733
原创 leetcode题目:Candy
题目: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 following requirements:Each child must have at
2014-05-07 15:17:56 481
原创 leetcode题目:Single Number和Single Number II
题目:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without
2014-05-07 15:11:25 409
原创 leetcode题目:Copy List with Random Pointer
题目: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 copy of the list.思路:主要是深层复制的问题:本题比较简
2014-05-06 16:04:32 610
原创 leetcode题目:Word Break和Word Break II
题目一: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.For example, givens = "leetcode",dict
2014-05-06 15:59:22 1042
原创 leetcode题目:Linked List Cycle和Linked List Cycle II
题目一:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?题目二:Given a linked list, return the node where the cycle begins. If
2014-05-05 14:34:51 440
原创 leetcode题目:Reorder List
题目: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.For example,Given {1,2,3,4}, reord
2014-05-05 10:41:22 452
原创 leetcode题目:Binary Tree Preorder Traversal
题目:Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3].Note: Recursi
2014-05-04 18:38:30 382
原创 leetcode题目:Binary Tree Postorder Traversal
题目:Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].Note: Recurs
2014-05-04 17:10:33 370
原创 leetcode题目:LRU Cache
题目:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of th
2014-05-04 14:27:30 526
原创 leetcode题目解答---Insertion Sort List
题目如下:Sort a linked list using insertion sort.使用插入排序法排列一个链表。
2014-04-24 19:37:10 478
原创 leetcode题目解答---- SortList
题目:Sort a linked list in O(n log n) time using constant space complexity.这题还是比较纠结的,因为对于时间he
2014-04-24 17:33:51 583
原创 leetcode题目解答--Max Points on a Line
题目见下:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.解析思路:1)
2014-04-23 15:40:47 515
原创 leetcode题目--Evaluate Reverse Polish Notation 答案
题目见下:Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples:
2014-04-22 16:33:25 568
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人