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

Function NewBinarySearch

structure/tree/bstree.go:46–51  ·  view source on GitHub ↗

NewBinarySearch creates a novel Binary-Search tree

()

Source from the content-addressed store, hash-verified

44
45// NewBinarySearch creates a novel Binary-Search tree
46func NewBinarySearch[T constraints.Ordered]() *BinarySearch[T] {
47 return &BinarySearch[T]{
48 Root: nil,
49 _NIL: nil,
50 }
51}
52
53// Empty determines the Binary-Search tree is empty
54func (t *BinarySearch[T]) Empty() bool {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected