2018年4月12日

blocking IO, non-blocking IO, asychronous IO, sychronous IO

摘要: https://blog.csdn.net/historyasamirror/article/details/5778378 言归正传。 同步(synchronous) IO和异步(asynchronous) IO,阻塞(blocking) IO和非阻塞(non-blocking)IO分别是什么,到 阅读全文

posted @ 2018-04-12 22:21 CreatorKou 阅读(186) 评论(0) 推荐(0) 编辑

2018年4月9日

使用set和vector去重(copy函数)

摘要: mark 阅读全文

posted @ 2018-04-09 23:23 CreatorKou 阅读(235) 评论(0) 推荐(0) 编辑

vector元素去重uninque函数,erase函数

摘要: 题目描述 明明想在学校中请一些同学一起做一项问卷调查,为了实验的客观性,他先用计算机生成了N个1到1000之间的随机整数(N≤1000),对于其中重复的数字,只保留一个,把其余相同的数去掉,不同的数对应着不同的学生的学号。然后再把这些数从小到大排序,按照排好的顺序去找同学做调查。请你协助明明完成“去 阅读全文

posted @ 2018-04-09 23:22 CreatorKou 阅读(392) 评论(0) 推荐(0) 编辑

copy与iterator头文件

摘要: mark 阅读全文

posted @ 2018-04-09 23:22 CreatorKou 阅读(119) 评论(0) 推荐(0) 编辑

2018年4月3日

构造树求解逆波兰表达式

摘要: 注意,由于中缀式的运算规则是从左到右,所以遍历left~right时从right遍历到left,先找到的运算符构造的节点必然有较低优先级的输出 将构造的树后序遍历得到逆波兰表达式: 阅读全文

posted @ 2018-04-03 00:50 CreatorKou 阅读(238) 评论(0) 推荐(0) 编辑

2018年4月2日

头插法翻转链表

摘要: 1 /* 2 struct ListNode { 3 int val; 4 struct ListNode *next; 5 ListNode(int x) : 6 val(x), next(NULL) { 7 } 8 };*/ 9 class Solution { 10 public: 11 ListNode* ... 阅读全文

posted @ 2018-04-02 22:03 CreatorKou 阅读(103) 评论(0) 推荐(0) 编辑

剑指offer 记录03

摘要: 牛客提示有段错误,栈溢出, 在gcc编译下没问题; 阅读全文

posted @ 2018-04-02 21:44 CreatorKou 阅读(80) 评论(0) 推荐(0) 编辑

剑指offer:数值的整数幂次

摘要: 1 class Solution { 2 public: 3 double Power(double base, int exponent) { 4 bool posit = (exponent > 0) ? true : false; 5 exponent = posit ? exponent : (-exponent); 6 ... 阅读全文

posted @ 2018-04-02 21:01 CreatorKou 阅读(195) 评论(0) 推荐(0) 编辑

剑指offer:二进制中1的个数

摘要: 输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。 解析:利用右移运算,前提将int转换为unsigned int,这样在无符号数上的右移操作等效于逻辑右移,而不是算术右移 阅读全文

posted @ 2018-04-02 20:53 CreatorKou 阅读(96) 评论(0) 推荐(0) 编辑

数据的二进制表示和位运算(算数&逻辑)

摘要: 在写嵌入式的程序中,常会将数据定义为unsigned int,这样定义有什么好处呢?下面从逻辑右移和算术右移的角度进行分析。 【分析】 1 逻辑右移和算术右移 逻辑右移,移走的位填充为0;算术右移,移走的位填充与符号位有关,例如如果为负数,则移走的位填充为1。 2 unsigned int 和 in 阅读全文

posted @ 2018-04-02 20:50 CreatorKou 阅读(199) 评论(0) 推荐(0) 编辑

导航