2012年11月25日

摘要: 1. 按螺旋方式打印矩阵: Print in spiral form as shown belowFor n=23 20 1For n=34 3 25 0 16 7 8For n=415 14 13 124 3 2 115 0 1 106 7 8 9 一看到这个题目应该比较容易想到递归,不过这个递归里面有些细节需要特别注意,代码如下: #include <iostream>#include <math.h>usingnamespace std;struct Position{ Position(int _x, int _y) { x = _x; y = _y;} int 阅读全文
posted @ 2012-11-25 13:07 做个不善的人 阅读(286) 评论(0) 推荐(0)
 
摘要: 线程和进程的区别和联系(What's the difference between process and thread? What kind of information does thread maintain? its own stack? heap?How and when to do a context switch? How do you handle an time slice i... 阅读全文
posted @ 2012-11-25 11:30 做个不善的人 阅读(209) 评论(0) 推荐(0)