bst

package
v0.0.0-...-24ca9bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BSTvertex

type BSTvertex struct {
	// contains filtered or unexported fields
}

type BinarySearchTree

type BinarySearchTree interface {
	Insert(node *Node)
	Delete(node *Node)
}

BinarySearchTree is a tree structure where three restrictions are in place to improve performance:

1. A Node can have two children at most.

2. For any given parent node, the child on the left has a value less or equal to the parent. For any given parent node, the child on the right has a value greater or equal to the parent.

3. No two nodes can have the same value.

The biggest advantage of BST's is that we can search through them in logarithmic time. Extremely popular for storing large quantities of data that must be easily searchable.

type Node

type Node struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL