From 859be40c570771807e822bcfdb8ebf56c5bcbbed Mon Sep 17 00:00:00 2001 From: DiDong <38174117+DiDongDongDi@users.noreply.github.com> Date: Sat, 29 Feb 2020 17:15:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `doSomething`应该是一个函数 `归并查找`改为`归并排序` --- README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2dda88c..cdc2567 100644 --- a/README.md +++ b/README.md @@ -1131,6 +1131,9 @@ catch (bad_cast b) { typeid、type_info 使用 ```cpp +#include +using namespace std; + class Flyable // 能飞的 { public: @@ -1143,6 +1146,7 @@ public: void foraging() {...} // 觅食 virtual void takeoff() {...} virtual void land() {...} + virtual ~Bird(){} }; class Plane : public Flyable // 飞机 { @@ -1164,7 +1168,7 @@ private: ... }; -class doSomething(Flyable *obj) // 做些事情 +void doSomething(Flyable *obj) // 做些事情 { obj->takeoff(); @@ -1177,7 +1181,15 @@ class doSomething(Flyable *obj) // 做些事情 } obj->land(); -}; +} + +int main(){ + Bird *b = new Bird(); + doSomething(b); + delete b; + b = nullptr; + return 0; +} ``` @@ -1472,13 +1484,13 @@ typedef struct { * 问题的分解 * 问题规模的分解 * 折半查找(递归) -* 归并查找(递归) +* 归并排序(递归) * 快速排序(递归) #### 递归与迭代 * 迭代:反复利用变量旧值推出新值 -* 折半查找(迭代) +* 折半排序(迭代) * 归并查找(迭代) #### 广义表 From 5c3c43733fc85d61c63fd7d9f9e276635850781d Mon Sep 17 00:00:00 2001 From: DiDong <38174117+DiDongDongDi@users.noreply.github.com> Date: Sat, 29 Feb 2020 17:18:52 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cdc2567..e50b4b7 100644 --- a/README.md +++ b/README.md @@ -1490,8 +1490,8 @@ typedef struct { #### 递归与迭代 * 迭代:反复利用变量旧值推出新值 -* 折半排序(迭代) -* 归并查找(迭代) +* 折半查找(迭代) +* 归并排序(迭代) #### 广义表