最近看linux0.11源码时,看到任务切换函数switch_to,感觉很晦涩,于是在网上查了一些资料,现在终于有些眉目,特记录于此,以方便大家参考,有什么错误或不足之处,还请大家指出~switch_to源码/** switch_to(n) should switch tasks to task ....
分类:
其他好文 时间:
2015-03-16 20:51:22
阅读次数:
167
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
You should preserve the original relative order of the nodes in each of...
分类:
其他好文 时间:
2015-03-16 17:55:05
阅读次数:
105
题目Given a binary tree, flatten it to a linked list in-place.For example,Given 1
/ 2 5
/ \ 3 4 6
The flattened tree should look like: 1
2
...
分类:
其他好文 时间:
2015-03-16 16:33:35
阅读次数:
121
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.一直没想出原址排序...
分类:
其他好文 时间:
2015-03-16 00:50:25
阅读次数:
215
191.For example, the 32-bit integer ’11' has binary representation00000000000000000000000000001011, so the function should return 3.Java codeint hammi...
分类:
其他好文 时间:
2015-03-15 22:52:06
阅读次数:
123
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...
分类:
其他好文 时间:
2015-03-15 19:48:26
阅读次数:
128
uva 10192 VacationThe ProblemYou are planning to take some rest and to go out on vacation, but you really don’t know which cities you should visit. So, you ask your parents for help. Your mother says “...
分类:
其他好文 时间:
2015-03-15 15:21:52
阅读次数:
197
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-03-15 12:13:53
阅读次数:
112
题目链接:Spiral Matrix II
Given an integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order.
For example,
Given n = 3,
You should return the following matrix:
[
[ 1,...
分类:
其他好文 时间:
2015-03-15 00:52:27
阅读次数:
386
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set toNULL.Initially, all next ...
分类:
其他好文 时间:
2015-03-15 00:28:29
阅读次数:
141