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.
 
 
 
 

729 B

btreemin

Instructions

Écrire une fonction, BTreeMin, qui retourne la node avec la valeur minimum de l'arbre donné par root.

Fonction attendue

func BTreeMin(root *TreeNode) *TreeNode {

}

Utilisation

Voici un éventuel programme pour tester votre fonction :

package main

import (
	"fmt"

	piscine ".."
)

func main() {
	root := &piscine.TreeNode{Data: "4"}
	piscine.BTreeInsertData(root, "1")
	piscine.BTreeInsertData(root, "7")
	piscine.BTreeInsertData(root, "5")
	min := piscine.BTreeMin(root)
	fmt.Println(min.Data)
}

Et son résultat :

student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/test$ ./test
1
student@ubuntu:~/student/test$