算法精粹(algorithm-essentials)

感谢soulmachine@github提供内容
## Flatten Binary Tree to Linked List


### 描述

Given a binary tree, flatten it to a linked list in-place.

For example, Given

```
1
/ \
2 5
/ \ \
3 4 6
```

The flattened tree should look like:

```
1
\
2
\
3
\
4
\
5
\
6
```

### 分析




### 递归版1

{% codesnippet "./code/flatten-binary-tree-to-linked-list-1."+book.suffix, language=book.suffix %}{% endcodesnippet %}


### 递归版2

{% codesnippet "./code/flatten-binary-tree-to-linked-list-2."+book.suffix, language=book.suffix %}{% endcodesnippet %}