Leetcode
PenyChow
这个作者很懒,什么都没留下…
展开
-
leetcode-Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in each of原创 2014-08-03 20:45:13 · 668 阅读 · 0 评论 -
Leetcode_Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function should return length = 5, and A is now [1,1,2,原创 2014-08-04 23:50:49 · 551 阅读 · 0 评论 -
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].原创 2014-08-04 23:40:40 · 481 阅读 · 0 评论 -
Leetcode_Wildcard Matching
字符串模式匹配实现原创 2014-08-04 23:43:29 · 824 阅读 · 0 评论 -
Leetcode_Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node's key.Th原创 2014-08-04 23:37:59 · 527 阅读 · 0 评论 -
Leetcode_Palindrome_Partitioning_DFS 算法
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 [ ["aa","原创 2014-08-04 23:18:14 · 508 阅读 · 0 评论 -
Leetcode_Merge Sorted Array
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 to m + n) to hold additional elements fro原创 2014-08-04 23:36:00 · 489 阅读 · 0 评论 -
Leetcode_Add Binary
leetcode_Add Binary原创 2014-08-04 23:44:22 · 688 阅读 · 0 评论 -
Leetcode_Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and [2,1,1].原创 2014-08-04 19:18:50 · 583 阅读 · 0 评论 -
leetcode_ReverseLinkedListII
Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satisfy t原创 2014-08-03 20:50:39 · 542 阅读 · 0 评论 -
leetcodr_AddTwoNumbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link原创 2014-08-03 20:54:17 · 548 阅读 · 0 评论 -
Leetcod_Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with原创 2014-08-04 23:53:07 · 561 阅读 · 0 评论