|
|
|
@ -23,23 +23,23 @@ 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") |
|
|
|
|
fmt.Println(student.BTreeIsBinary(root)) |
|
|
|
|
root := &piscine.TreeNode{Data: "4"} |
|
|
|
|
piscine.BTreeInsertData(root, "1") |
|
|
|
|
piscine.BTreeInsertData(root, "7") |
|
|
|
|
piscine.BTreeInsertData(root, "5") |
|
|
|
|
fmt.Println(piscine.BTreeIsBinary(root)) |
|
|
|
|
} |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
And its output : |
|
|
|
|
|
|
|
|
|
```console |
|
|
|
|
student@ubuntu:~/student/btreeisbinary$ go build |
|
|
|
|
student@ubuntu:~/student/btreeisbinary$ ./btreeisbinary |
|
|
|
|
student@ubuntu:~/student/test$ go build |
|
|
|
|
student@ubuntu:~/student/test$ ./test |
|
|
|
|
true |
|
|
|
|
student@ubuntu:~/student/btreeisbinary$ |
|
|
|
|
student@ubuntu:~/student/test$ |
|
|
|
|
``` |
|
|
|
|