2015年9月6日

求N位格雷码(递归版and循环版and位运算版)

摘要: #include #include using namespace std;vector func(size_t n){ vecto... 阅读全文

posted @ 2015-09-06 20:55 泉山绿树 阅读(24) 评论(0) 推荐(0)

2015年9月1日

期望时间为线性时间的选择算法(C++)

摘要: #include using namespace std;void exchange(int& x, int& y){ int... 阅读全文

posted @ 2015-09-01 19:31 泉山绿树 阅读(34) 评论(0) 推荐(0)

2015年8月31日

算法导论计数排序实现(C++)

摘要: #include using namespace std;#define len 5 void countSorting(int A... 阅读全文

posted @ 2015-08-31 22:47 泉山绿树 阅读(20) 评论(0) 推荐(0)

2015年8月30日

算法导论快排实现(C++)

摘要: 算法导论的快排算法, #include using namespace std;int a[] = {9};void exchang... 阅读全文

posted @ 2015-08-30 22:28 泉山绿树 阅读(49) 评论(0) 推荐(0)

2015年7月29日

cin深入分析(下) - cin的错误处理(转)

摘要: 深入了解cin错误处理机制,深入了解cin.clear/cin.ignore/cin.good/cin.fail等函数 在前一节中... 阅读全文

posted @ 2015-07-29 20:50 泉山绿树 阅读(129) 评论(0) 推荐(0)

cin深入分析(上) - cin输入操作处理(转)

摘要: cinusing namespace std;int main(){ int m, n; cin>>m; ... 阅读全文

posted @ 2015-07-29 20:27 泉山绿树 阅读(83) 评论(0) 推荐(0)

2015年7月17日

C++类内为什么不能定义非const的static成员(待续)

摘要: 学习CppPimer的时候遇到这个问题,google下最终解决我的疑惑,分享上来 class Account{ public... 阅读全文

posted @ 2015-07-17 16:51 泉山绿树 阅读(32) 评论(0) 推荐(0)

2015年7月12日

sizeof,终极无惑『转』

摘要: 前向声明 sizeof,一个其貌不扬的家伙,引无数菜鸟竟折腰,小虾我当初也没少犯迷糊,秉着“辛苦我一个,幸福千万人”的伟大思想,我决... 阅读全文

posted @ 2015-07-12 01:59 泉山绿树 阅读(38) 评论(0) 推荐(0)

5分钟搞定内存对齐『转』

摘要: 写出一个struct,然后sizeof,你会不会经常对结果感到奇怪?sizeof的结果往往都比你声明的变量总长度要大,这是怎么回事呢... 阅读全文

posted @ 2015-07-12 01:33 泉山绿树 阅读(23) 评论(0) 推荐(0)

2015年6月19日

轻松记忆所谓“大小端”

摘要: 稍有些英语常识的人都会知道,如果单靠字面意思来理解俚语,那是很难猜到它的正确含义的。在计算机里,对于地址的描述,很少用“大”和“小”... 阅读全文

posted @ 2015-06-19 01:36 泉山绿树 阅读(42) 评论(0) 推荐(0)

导航