来自:http://blog.chinaunix.net/space.php?uid=23061624&do=blog&cuid=2127853信号量用在多线程多任务同步的,一个线程完成了某一个动作就通过信号量告诉别的线程,别的线程再进行某些动作(大家都在semtake的时候,就阻塞在哪里)。而互斥...
分类:
其他好文 时间:
2015-07-21 12:17:44
阅读次数:
118
CTRL + space in the textboxes gives you all kinds of suggestions for regular expression writing.查找替换Be sure to check out the \C regular expression ope...
分类:
系统相关 时间:
2015-07-21 01:20:12
阅读次数:
479
题目:
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
pretty straight forward. Could ...
分类:
编程语言 时间:
2015-07-20 23:47:29
阅读次数:
169
题目描述
链接地址
解法
算法解释题目描述Given 2*n + 2 numbers, every numbers occurs twice except two, find them.ExampleGiven [1,2,2,3,4,4,5,3] return 1 and 5ChallengeO(n) time, O(1) extra space.
.链接地址http://www.lintcode...
分类:
其他好文 时间:
2015-07-20 23:32:36
阅读次数:
137
Maximum Gap: https://leetcode.com/problems/maximum-gap/
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Ret...
分类:
其他好文 时间:
2015-07-20 16:34:03
阅读次数:
158
Given an integer array of size n, find all elements that appear more than ? n/3 ? times. The algorithm should run in linear time and in O(1) space.Hint:How many majority elements could it possibly hav...
分类:
其他好文 时间:
2015-07-20 16:28:47
阅读次数:
133
大家应该都知道用text-overflow:ellipsis属性来实现单行文本的溢出显示省略号(…)。当然部分浏览器还需要加宽度width属性。overflow: hidden;text-overflow: ellipsis;white-space: nowrap;但是这个属性并不支持多行文本溢出显...
分类:
其他好文 时间:
2015-07-20 14:22:55
阅读次数:
146
DescriptionThe NASA Space Center, Houston, is less than 200 miles from San Antonio, Texas (the site of the ACM Finals this year). This is the place wh...
分类:
其他好文 时间:
2015-07-20 12:13:19
阅读次数:
120
维基百科创建数组To create an array with four elements in a single row, separate the elements with either acomma (,) or a space.a = [1 2 3 4]%行向量All MATLAB var...
分类:
其他好文 时间:
2015-07-20 12:11:54
阅读次数:
137
Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that is great...
分类:
其他好文 时间:
2015-07-20 10:33:13
阅读次数:
108