Documentation ¶
Index ¶
- type BinaryTree
- func (st *BinaryTree[Ord, T]) Del(key Ord)
- func (st *BinaryTree[Ord, T]) Get(key Ord) (T, bool)
- func (st *BinaryTree[Ord, T]) GetMax() T
- func (st *BinaryTree[Ord, T]) GetMin() T
- func (st *BinaryTree[Ord, T]) InOrder(fn func(*Node[Ord, T]) bool)
- func (st *BinaryTree[Ord, T]) LevelOrder(fn func(*Node[Ord, T]) bool)
- func (st *BinaryTree[Ord, T]) PreOrder(fn func(*Node[Ord, T]) bool)
- func (st *BinaryTree[Ord, T]) Put(key Ord, val T)
- func (st *BinaryTree[Ord, T]) ReverseOrder(fn func(*Node[Ord, T]) bool)
- func (st *BinaryTree[Ord, T]) Size() uint
- func (st *BinaryTree[Ord, T]) SufOrder(fn func(*Node[Ord, T]) bool)
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryTree ¶
type BinaryTree[Ord constraints.Ordered, T any] struct { // contains filtered or unexported fields }
BinaryTree is a simple binary search tree that does not guarantee balance
func New ¶
func New[Ord constraints.Ordered, T any]() *BinaryTree[Ord, T]
func (*BinaryTree[Ord, T]) Del ¶
func (st *BinaryTree[Ord, T]) Del(key Ord)
func (*BinaryTree[Ord, T]) Get ¶
func (st *BinaryTree[Ord, T]) Get(key Ord) (T, bool)
func (*BinaryTree[Ord, T]) GetMax ¶
func (st *BinaryTree[Ord, T]) GetMax() T
func (*BinaryTree[Ord, T]) GetMin ¶
func (st *BinaryTree[Ord, T]) GetMin() T
func (*BinaryTree[Ord, T]) InOrder ¶
func (st *BinaryTree[Ord, T]) InOrder(fn func(*Node[Ord, T]) bool)
func (*BinaryTree[Ord, T]) LevelOrder ¶
func (st *BinaryTree[Ord, T]) LevelOrder(fn func(*Node[Ord, T]) bool)
func (*BinaryTree[Ord, T]) PreOrder ¶
func (st *BinaryTree[Ord, T]) PreOrder(fn func(*Node[Ord, T]) bool)
func (*BinaryTree[Ord, T]) Put ¶
func (st *BinaryTree[Ord, T]) Put(key Ord, val T)
func (*BinaryTree[Ord, T]) ReverseOrder ¶
func (st *BinaryTree[Ord, T]) ReverseOrder(fn func(*Node[Ord, T]) bool)
func (*BinaryTree[Ord, T]) Size ¶
func (st *BinaryTree[Ord, T]) Size() uint
func (*BinaryTree[Ord, T]) SufOrder ¶
func (st *BinaryTree[Ord, T]) SufOrder(fn func(*Node[Ord, T]) bool)
type Node ¶
type Node[Ord constraints.Ordered, T any] struct { // contains filtered or unexported fields }
func (*Node[Ord, T]) Left ¶
func (n *Node[Ord, T]) Left() search.ITraversal
func (*Node[Ord, T]) Right ¶
func (n *Node[Ord, T]) Right() search.ITraversal
Click to show internal directories.
Click to hide internal directories.