Browse Source

Merge pull request #218 from 01-edu/fixBtreeapplybylevel

raeame btreeapplybylevel from quest 12
pull/222/head^2
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 ### 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. This function must have the following signature.
@ -23,26 +23,26 @@ package main
import ( import (
"fmt" "fmt"
student ".." piscine ".."
) )
func main() { func main() {
root := &student.TreeNode{Data: "4"} root := &piscine.TreeNode{Data: "4"}
student.BTreeInsertData(root, "1") piscine.BTreeInsertData(root, "1")
student.BTreeInsertData(root, "7") piscine.BTreeInsertData(root, "7")
student.BTreeInsertData(root, "5") piscine.BTreeInsertData(root, "5")
student.BTreeApplyByLevel(root, fmt.Println) piscine.BTreeApplyByLevel(root, fmt.Println)
} }
``` ```
And its output : And its output :
```console ```console
student@ubuntu:~/student/btreeapplybylevel$ go build student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/btreeapplybylevel$ ./btreeapplybylevel student@ubuntu:~/student/test$ ./test
4 4
1 1
7 7
5 5
student@ubuntu:~/student/btreeapplybylevel$ student@ubuntu:~/student/test$
``` ```

20
subjects/btreeapplybylevel.fr.md

@ -2,7 +2,7 @@
### Instructions ### 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. This function must have the following signature.
@ -23,26 +23,26 @@ package main
import ( import (
"fmt" "fmt"
student ".." piscine ".."
) )
func main() { func main() {
root := &student.TreeNode{Data: "4"} root := &piscine.TreeNode{Data: "4"}
student.BTreeInsertData(root, "1") piscine.BTreeInsertData(root, "1")
student.BTreeInsertData(root, "7") piscine.BTreeInsertData(root, "7")
student.BTreeInsertData(root, "5") piscine.BTreeInsertData(root, "5")
student.BTreeApplyByLevel(root, fmt.Println) piscine.BTreeApplyByLevel(root, fmt.Println)
} }
``` ```
And its output : And its output :
```console ```console
student@ubuntu:~/student/btreeapplybylevel$ go build student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/btreeapplybylevel$ ./btreeapplybylevel student@ubuntu:~/student/test$ ./test
4 4
1 1
7 7
5 5
student@ubuntu:~/student/btreeapplybylevel$ student@ubuntu:~/student/test$
``` ```

Loading…
Cancel
Save