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.
 
 
 
 
 
 

18 lines
372 B

package main
import (
"fmt"
)
func main() {
root := &TreeNode{Data: "4"}
BTreeInsertData(root, "1")
BTreeInsertData(root, "7")
BTreeInsertData(root, "5")
node := BTreeSearchItem(root, "4")
fmt.Println("Before delete:")
BTreeApplyInorder(root, fmt.Println)
root = BTreeDeleteNode(root, node)
fmt.Println("After delete:")
BTreeApplyInorder(root, fmt.Println)
}