更新 二叉树的递归遍历 go版本的代码格式

This commit is contained in:
NevS 2021-06-15 21:11:42 +08:00 committed by GitHub
parent 3461b91704
commit b3eacc519b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -221,7 +221,7 @@ class Solution:
Go
前序遍历:
```
```go
func PreorderTraversal(root *TreeNode) (res []int) {
var traversal func(node *TreeNode)
traversal = func(node *TreeNode) {
@ -239,7 +239,7 @@ func PreorderTraversal(root *TreeNode) (res []int) {
```
中序遍历:
```
```go
func InorderTraversal(root *TreeNode) (res []int) {
var traversal func(node *TreeNode)
traversal = func(node *TreeNode) {
@ -256,7 +256,7 @@ func InorderTraversal(root *TreeNode) (res []int) {
```
后序遍历:
```
```go
func PostorderTraversal(root *TreeNode) (res []int) {
var traversal func(node *TreeNode)
traversal = func(node *TreeNode) {