Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru...
分类:
其他好文 时间:
2015-02-10 14:55:06
阅读次数:
155
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ...
分类:
其他好文 时间:
2015-02-10 14:48:19
阅读次数:
126
题目:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should ...
分类:
移动开发 时间:
2015-02-10 13:02:20
阅读次数:
120
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you shouldreturn the list as 2->1->4->3.
Your algorithm should use only constant space. You ma...
分类:
其他好文 时间:
2015-02-10 09:18:43
阅读次数:
143
1 题目There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should...
分类:
其他好文 时间:
2015-02-09 22:49:25
阅读次数:
219
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).思路分析:这题容易想到O(m+n)的解法,就是先Merge两个数组,然后返...
分类:
其他好文 时间:
2015-02-09 16:06:53
阅读次数:
106
Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:
其他好文 时间:
2015-02-09 15:47:09
阅读次数:
151
Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi...
分类:
其他好文 时间:
2015-02-09 15:31:55
阅读次数:
161
Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right) justified.You should p...
分类:
其他好文 时间:
2015-02-09 15:28:49
阅读次数:
124
Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ret...
分类:
其他好文 时间:
2015-02-09 15:24:59
阅读次数:
125