Browse Source

Merge pull request #218 from 01-edu/fixBtreeapplybylevel

raeame btreeapplybylevel from quest 12
content-update
augusto-mantilla 5 years ago committed by GitHub
parent
commit
f24fabf7b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      subjects/btreeapplybylevel.en.md
  2. 20
      subjects/btreeapplybylevel.fr.md

20
subjects/btreeapplybylevel.en.md

@ -2,7 +2,7 @@
### Instructions
Write a function, BTreeApplyByLevel, that applies the function given by fn to each node of the tree given by root.
Write a function, `BTreeApplyByLevel`, that applies the function given by fn to each node of the tree given by root.
This function must have the following signature.
@ -23,26 +23,26 @@ package main
import (
"fmt"
student ".."
piscine ".."
)
func main() {
root := &student.TreeNode{Data: "4"}
student.BTreeInsertData(root, "1")
student.BTreeInsertData(root, "7")
student.BTreeInsertData(root, "5")
student.BTreeApplyByLevel(root, fmt.Println)
root := &piscine.TreeNode{Data: "4"}
piscine.BTreeInsertData(root, "1")
piscine.BTreeInsertData(root, "7")
piscine.BTreeInsertData(root, "5")
piscine.BTreeApplyByLevel(root, fmt.Println)
}
```
And its output :
```console
student@ubuntu:~/student/btreeapplybylevel$ go build
student@ubuntu:~/student/btreeapplybylevel$ ./btreeapplybylevel
student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/test$ ./test
4
1
7
5
student@ubuntu:~/student/btreeapplybylevel$
student@ubuntu:~/student/test$
```

20
subjects/btreeapplybylevel.fr.md

@ -2,7 +2,7 @@
### Instructions
Write a function, BTreeApplyByLevel, that applies the function given by fn to each node of the tree given by root.
Write a function, `BTreeApplyByLevel`, that applies the function given by fn to each node of the tree given by root.
This function must have the following signature.
@ -23,26 +23,26 @@ package main
import (
"fmt"
student ".."
piscine ".."
)
func main() {
root := &student.TreeNode{Data: "4"}
student.BTreeInsertData(root, "1")
student.BTreeInsertData(root, "7")
student.BTreeInsertData(root, "5")
student.BTreeApplyByLevel(root, fmt.Println)
root := &piscine.TreeNode{Data: "4"}
piscine.BTreeInsertData(root, "1")
piscine.BTreeInsertData(root, "7")
piscine.BTreeInsertData(root, "5")
piscine.BTreeApplyByLevel(root, fmt.Println)
}
```
And its output :
```console
student@ubuntu:~/student/btreeapplybylevel$ go build
student@ubuntu:~/student/btreeapplybylevel$ ./btreeapplybylevel
student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/test$ ./test
4
1
7
5
student@ubuntu:~/student/btreeapplybylevel$
student@ubuntu:~/student/test$
```

Loading…
Cancel
Save