摘要: 本文为个人学习笔记。简单的单链表实现。 实现过程中到的问题: ①:定义指针要赋值,或者new一个新的空间。 ②:delete 不能随便用。。。先来两张常见基本指针操作截图,再上代码头文件: 1 #include 2 using namespace std; 3 4 struct Node ... 阅读全文
posted @ 2014-12-04 16:24 小痴_r 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 个人学习笔记递归是指函数调用自己本身。想知道什么是递归,首先你得知道什么是递归。下面是一个显示当n为不同值时运行时间的小程序#include #include using namespace std;clock_t start = clock(); int f(long int num){ if(... 阅读全文
posted @ 2014-12-04 16:04 小痴_r 阅读(162) 评论(0) 推荐(0) 编辑
摘要: const 引用double num = 2.12; const int &refer = num; //相当于int temp = num;const int &refer = temp; //当num值改变时,refer不变,因为const引用是只读的。 //当nu... 阅读全文
posted @ 2014-12-04 15:42 小痴_r 阅读(100) 评论(0) 推荐(0) 编辑