Browse Source

readme btreemax from quest 12

pull/219/head
lee 5 years ago
parent
commit
dfae81bbd1
  1. 21
      subjects/btreemax.en.md
  2. 21
      subjects/btreemax.fr.md

21
subjects/btreemax.en.md

@ -2,7 +2,7 @@
### Instructions ### Instructions
Write a function, BTreeMax, that returns the node with the maximum value in the tree given by root Write a function, `BTreeMax`, that returns the node with the maximum value in the tree given by root
This function must have the following signature. This function must have the following signature.
@ -23,15 +23,16 @@ 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")
max := student.BTreeMax(root) max := piscine.BTreeMax(root)
fmt.Println(max.Data) fmt.Println(max.Data)
} }
``` ```
@ -39,8 +40,8 @@ func main() {
And its output : And its output :
```console ```console
student@ubuntu:~/student/btreemax$ go build student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/btreemax$ ./btreemax student@ubuntu:~/student/test$ ./test
7 7
student@ubuntu:~/student/btreemax$ student@ubuntu:~/student/test$
``` ```

21
subjects/btreemax.fr.md

@ -2,7 +2,7 @@
### Instructions ### Instructions
Write a function, BTreeMax, that returns the node with the maximum value in the tree given by root Write a function, `BTreeMax`, that returns the node with the maximum value in the tree given by root
This function must have the following signature. This function must have the following signature.
@ -23,15 +23,16 @@ 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")
max := student.BTreeMax(root) max := piscine.BTreeMax(root)
fmt.Println(max.Data) fmt.Println(max.Data)
} }
``` ```
@ -39,8 +40,8 @@ func main() {
And its output : And its output :
```console ```console
student@ubuntu:~/student/btreemax$ go build student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/btreemax$ ./btreemax student@ubuntu:~/student/test$ ./test
7 7
student@ubuntu:~/student/btreemax$ student@ubuntu:~/student/test$
``` ```

Loading…
Cancel
Save