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