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

Struct BinarySearch

structure/tree/bstree.go:40–43  ·  view source on GitHub ↗

BinarySearch represents a Binary-Search tree. By default, _NIL = nil.

Source from the content-addressed store, hash-verified

38// BinarySearch represents a Binary-Search tree.
39// By default, _NIL = nil.
40type BinarySearch[T constraints.Ordered] struct {
41 Root *BSNode[T]
42 _NIL *BSNode[T] // a sentinel value for nil
43}
44
45// NewBinarySearch creates a novel Binary-Search tree
46func NewBinarySearch[T constraints.Ordered]() *BinarySearch[T] {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected