You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
799 B

## btreeprintroot
### Instructions
Écrire une fonction qui affiche la valeur de node `root` d'un arbre binaire.
Les nodes doivent être définies comme ci-dessous:
### Fonction attendue
```go
type TreeNode struct {
4 years ago
left, right *TreeNode
data string
}
func PrintRoot(root *TreeNode){
}
```
### Utilisation
Voici un éventuel programme pour tester votre fonction :
```go
package main
func main() {
//rootNode initialized with the value "who"
//rootNode1 initialized with the value "are"
//rootNode2 initialized with the value "you"
printRoot(rootNode)
printRoot(rootNode1)
printRoot(rootNode2)
}
```
Et son résultat :
```console
student@ubuntu:~/[[ROOT]]/printroot$ go build
student@ubuntu:~/[[ROOT]]/printroot$ ./printroot
who
are
you
student@ubuntu:~/[[ROOT]]/test$
```