MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Delete

Method Delete

structure/tree/avl.go:74–81  ·  view source on GitHub ↗

Delete a Node from the AVL Tree

(key T)

Source from the content-addressed store, hash-verified

72
73// Delete a Node from the AVL Tree
74func (avl *AVL[T]) Delete(key T) bool {
75 if !avl.Has(key) {
76 return false
77 }
78
79 avl.Root = avl.deleteHelper(avl.Root, key)
80 return true
81}
82
83// Get a Node from the AVL Tree
84func (avl *AVL[T]) Get(key T) (Node[T], bool) {

Callers

nothing calls this directly

Calls 2

HasMethod · 0.95
deleteHelperMethod · 0.95

Tested by

no test coverage detected