Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i...
分类:
其他好文 时间:
2015-01-13 23:09:55
阅读次数:
151
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 from ...
分类:
其他好文 时间:
2015-01-13 17:51:17
阅读次数:
180
Sort a linked list in O(n log n)
time using constant space complexity.
#include
#include
typedef struct ListNode{
int val;
struct ListNode *next;
}ListNode;
ListNode *mergesort(ListNode *...
分类:
其他好文 时间:
2015-01-13 17:42:46
阅读次数:
113
Given 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 you use extra space?
A straight forward solution using O(m...
分类:
其他好文 时间:
2015-01-13 10:39:06
阅读次数:
156
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ...
分类:
编程语言 时间:
2015-01-13 06:42:51
阅读次数:
201
【题目】
Sort a linked list in O(n log n)
time using constant space complexity.
【分析】
单链表适合用归并排序,双向链表适合用快速排序。本题可以复用Merge Two Sorted Lists方法
【代码】
/*********************************
* 日期:2015-01-1...
分类:
其他好文 时间:
2015-01-13 00:10:40
阅读次数:
184
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
Try to solve it in linear time/space.
Return 0 if the array contains less than 2 elements.
Y...
分类:
编程语言 时间:
2015-01-12 22:34:27
阅读次数:
274
注:1、下文中所有HTTP请求所指的Host都是f.10086.cn2、目前只有中国移动用户可以使用1、打开登录页面:GET /huc/user/space/login.do?m=submit&fr=space,获取两个cookie值:JSESSIONID和UUID2、登录:POST /huc/us...
分类:
Web程序 时间:
2015-01-12 22:25:55
阅读次数:
283
http://www.freeformatter.com/html-entities.htmlCharacterEntity NameEntity NumberDescription Space!!Exclamation mark""Quotation mark##N...
分类:
其他好文 时间:
2015-01-12 22:21:32
阅读次数:
112
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 from ...
分类:
编程语言 时间:
2015-01-12 21:01:06
阅读次数:
280