Skip to content

Commit

Permalink
Merge pull request huihut#57 from DiDongDongDi/master
Browse files Browse the repository at this point in the history
修改可能的错误
  • Loading branch information
huihut authored Feb 29, 2020
2 parents 8cf0448 + 5c3c437 commit 8f6182e
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,9 @@ catch (bad_cast b) {
typeid、type_info 使用

```cpp
#include <iostream>
using namespace std;

class Flyable // 能飞的
{
public:
Expand All @@ -1143,6 +1146,7 @@ public:
void foraging() {...} // 觅食
virtual void takeoff() {...}
virtual void land() {...}
virtual ~Bird(){}
};
class Plane : public Flyable // 飞机
{
Expand All @@ -1164,7 +1168,7 @@ private:
...
};

class doSomething(Flyable *obj) // 做些事情
void doSomething(Flyable *obj) // 做些事情
{
obj->takeoff();

Expand All @@ -1177,7 +1181,15 @@ class doSomething(Flyable *obj) // 做些事情
}

obj->land();
};
}

int main(){
Bird *b = new Bird();
doSomething(b);
delete b;
b = nullptr;
return 0;
}
```
Expand Down Expand Up @@ -1472,14 +1484,14 @@ typedef struct {
* 问题的分解
* 问题规模的分解
* 折半查找(递归)
* 归并查找(递归)
* 归并排序(递归)
* 快速排序(递归)

#### 递归与迭代

* 迭代:反复利用变量旧值推出新值
* 折半查找(迭代)
* 归并查找(迭代)
* 归并排序(迭代)

#### 广义表

Expand Down

0 comments on commit 8f6182e

Please sign in to comment.