Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space. Y...
分类:
其他好文 时间:
2014-11-28 16:26:03
阅读次数:
129
参考资料:1 .浅谈Memory Reordering2.透过LINUX内核看无锁编程3.Why the "volatile" type class should not be useddfsdf4.锁的意义spinlock(自旋锁)lock-free(无锁编程)mutex(互斥锁)read_wri...
分类:
其他好文 时间:
2014-11-28 09:51:45
阅读次数:
185
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:
其他好文 时间:
2014-11-28 06:15:51
阅读次数:
215
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.注意写出鲁棒性的代...
分类:
其他好文 时间:
2014-11-27 23:30:28
阅读次数:
202
Problem DescriptionGive you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".Inputeach test case contains two numbers A ...
分类:
编程语言 时间:
2014-11-27 20:29:03
阅读次数:
224
题目描述:
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 ...
分类:
其他好文 时间:
2014-11-27 16:16:38
阅读次数:
122
http://stackoverflow.com/questions/18526909/whether-i-should-use-propertynonatomic-copy-or-propertynonatomic-strong-fo'copy' will cause the setter for...
分类:
其他好文 时间:
2014-11-27 15:47:21
阅读次数:
193
Sort a linked list in O(n log n) time using constant space complexity.Analsys:We use Merge Sort.NOTE: We should practice other sort algorithm, linke Q...
分类:
其他好文 时间:
2014-11-27 01:35:39
阅读次数:
213
question:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of t...
分类:
其他好文 时间:
2014-11-26 23:59:52
阅读次数:
381
Description
Given an undirected weighted graph
G , you should find one of spanning trees specified as follows.
The graph G is an ordered pair
(V, E) , where V is a set of vertices
{v1, v2...
分类:
其他好文 时间:
2014-11-26 22:45:41
阅读次数:
364