摘要: SJTUBEAR 原创作品转载请注明出处 《Linux内核分析》MOOC课程http://mooc.study.163.com/course/USTC-1000029000我们通过简单地内核来模拟一下linux的系统调度,代码如下:/* * linux/mykernel/mymain.c * * ... 阅读全文
posted @ 2015-03-14 22:19 sjtubear 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 因为该死的windows自动更新,所以vmplayer经常会被强制关闭。但重新启动后,会发生不能连接到网络的情况显示:waiting for the network configuration……Waiting for 60 seconds more for network configuratio... 阅读全文
posted @ 2015-03-13 15:59 sjtubear 阅读(1043) 评论(0) 推荐(0) 编辑
摘要: SJTUBEAR 原创作品转载请注明出处 /《Linux内核分析》MOOC课程http://mooc.study.163.com/course/USTC-10000290001. 汇编 在修习LINUX内核这门课的初始阶段,首先需要掌握的就是汇编以及汇编程序对于堆栈的操作。 下面我们就来... 阅读全文
posted @ 2015-03-07 11:04 sjtubear 阅读(1369) 评论(0) 推荐(0) 编辑
摘要: 1.题目: A game for one player is played on a board consisting of N consecutive squares, numbered from 0 to N − 1. There is a number written on each squa... 阅读全文
posted @ 2015-01-21 17:28 sjtubear 阅读(878) 评论(0) 推荐(0) 编辑
摘要: How to solve this HARD issue1. Problem: A non-empty zero-indexed array A consisting of N integers is given.Apeakis an array element which is larger th... 阅读全文
posted @ 2015-01-19 21:54 sjtubear 阅读(1250) 评论(0) 推荐(0) 编辑
摘要: 在面对整数时,要留心整数溢出的情况。 在探索一个数有多少个除数的程序中,原本我们只要累加自然数到大于根号N停止即可。 不过因为计算机的整数范围的限制,我们需要判断是否i*i<(i-1)*(i-1)。 如果发生这种情况,说明整数溢出了~ 阅读全文
posted @ 2015-01-19 17:57 sjtubear 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 以为所有N的除数都是以根号N为轴对称的。 例如16的开方为4; 16%1 == 0 则1 与 16 都是16的除数。 16%2 == 0 则2 与 8 都是16的除数。 16%4 ==0 则4 为16 的除数。 如果继续查找,找到 8 则已经添加。 所以判断一个数为质数与否的复杂度为O(根号N) 阅读全文
posted @ 2015-01-19 17:23 sjtubear 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 1. 上题目:Task descriptionA non-empty zero-indexed array A consisting of N integers is given.A triplet (X, Y, Z), such that 0 ≤ X 0)18 {19 ... 阅读全文
posted @ 2015-01-19 17:14 sjtubear 阅读(970) 评论(0) 推荐(0) 编辑
摘要: 对于使用stack进行()的配对检查,不需要使用额外的空间对每个字符进行存储和push与pop的操作。 只使用size对()进行处理即可,因为只有一种括号,所以入栈为size加1,出栈为size-1.如果size<0,说明配对失败。 这样将空间从O(N)降为O(1); 阅读全文
posted @ 2015-01-19 10:33 sjtubear 阅读(130) 评论(0) 推荐(0) 编辑
摘要: A string S consisting of N characters is considered to be properly nested if any of the following conditions is true:S is empty; S has the form "(U)" ... 阅读全文
posted @ 2015-01-19 10:17 sjtubear 阅读(294) 评论(0) 推荐(0) 编辑