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

Method Has

structure/tree/bstree.go:81–84  ·  view source on GitHub ↗

Has Determines the tree has the node of Key

(key T)

Source from the content-addressed store, hash-verified

79
80// Has Determines the tree has the node of Key
81func (t *BinarySearch[T]) Has(key T) bool {
82 _, ok := searchTreeHelper[T](t.Root, t._NIL, key)
83 return ok
84}
85
86// PreOrder Traverses the tree in the following order Root --> Left --> Right
87func (t *BinarySearch[T]) PreOrder() []T {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected