- 博客(13)
- 资源 (20)
- 收藏
- 关注
原创 leetcode 链表 Insertion Sort List
Insertion Sort List Total Accepted: 24444 Total Submissions: 96639My SubmissionsSort a linked list using insertion sort.题意:用插入排序对一个链表排序思路:插入排序对当前元素在前面已经排好的元素中找到一个位置
2014-10-13 12:00:38 1038
原创 leetcode dfs Palindrome Partitioning
Palindrome Partitioning Total Accepted: 21056 Total Submissions: 81036My SubmissionsGiven a string s, partition s such that every substring of the partition is a palindrome.Return all
2014-10-13 10:29:32 920
原创 leetcode dfs Validate Binary Search Tree
Validate Binary Search Tree Total Accepted: 23828 Total Submissions: 91943My SubmissionsGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined
2014-10-12 15:34:35 1012
原创 leetcode 二分查找 Sqrt(x)
Sqrt(x) Total Accepted: 26074 Total Submissions: 116517My SubmissionsImplement int sqrt(int x).Compute and return the square root of x.题意:实现求方根 sqrt(x)思路:二分法对于一个数,它的方
2014-10-12 14:36:47 1570
原创 leetcode 二分法 Pow(x, n)
Pow(x, n) Total Accepted: 25273 Total Submissions: 97470My SubmissionsImplement pow(x, n).题意:求x的n次幂思路:二分法n有可能是负的或正的当n为负是,pow(x, n) = 1/pow(x, -n)x^n = x^{n/2} *
2014-10-12 11:15:47 1330
原创 leetcode dfs Subsets II
Subsets II Total Accepted: 19243 Total Submissions: 71148My SubmissionsGiven a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements
2014-10-12 10:08:19 829
原创 leetcode 链表 Partition List
Partition List Total Accepted: 19761 Total Submissions: 73252My SubmissionsGiven a linked list and a value x, partition it such that all nodes less than x come before nodes greater than
2014-10-12 00:15:47 1030
原创 leetcode dfs Convert Sorted List to Binary Search Tree
Convert Sorted List to Binary Search Tree Total Accepted: 21420 Total Submissions: 78476My SubmissionsGiven a singly linked list where elements are sorted in ascending order, convert it
2014-10-11 20:42:15 968
原创 leetcode dfs Flatten Binary Tree to Linked List
Flatten Binary Tree to Linked List Total Accepted: 25034 Total Submissions: 88947My SubmissionsGiven a binary tree, flatten it to a linked list in-place.For example,Given 1
2014-10-11 18:07:39 876
原创 leetcode dfs Minimum Depth of Binary Tree
Minimum Depth of Binary Tree Total Accepted: 25609 Total Submissions: 86491My SubmissionsGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the
2014-10-11 16:00:29 807
原创 leetcode 二分查找 Search for a Range
Search for a Range Total Accepted: 21480 Total Submissions: 78454My SubmissionsGiven a sorted array of integers, find the starting and ending position of a given target value.Your algo
2014-10-10 21:30:41 920
原创 leetcode 二分查找 Search in Rotated Sorted ArrayII
Search in Rotated Sorted Array II Total Accepted: 18500 Total Submissions: 59945My SubmissionsFollow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this
2014-10-10 20:02:08 902
原创 leetcode 二分查找 Search in Rotated Sorted Array
题意:一个已经排序好的数组,被按某个位置旋转了一次,给定一个值target,在该旋转后的数组里查找该值。思路:二分查找难点在于确定往数组的哪一半段继续二分查找设起点、中间点、终点分别为 start、middle、end (采用前闭后开的区间表示方法如果target = A[middle] return middle如果A[middle] >= A[start],则[start,
2014-10-10 19:48:43 825
UNIX网络编程 卷1
2012-08-13
Android中文合集(126+8篇)
2011-10-05
java编程思想(第4版)
2011-09-04
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人