ost

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package ost provides the interfaces for order statistic trees, which are binary trees with the ability to perform log(n) time searches for elements in the tree with a specified rank, as well as log(n) time retrieval for the rank of a specified element in the tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node interface {
	Left() (Node, error)
	Right() (Node, error)
	Size() int
	Value() float64
	Select(int) order.Node
	Rank(float64) int
	TreeString() string
}

Node is the interface for any node struct within an Tree.

type Tree

type Tree interface {
	Size() int
	Add(float64)
	Remove(float64)
	Select(int) order.Node
	Rank(float64) int
	String() string
	Clear()
}

Tree is the interface for order statistic trees, which are variants of binary trees that provide two additional methods: Select(i), which finds the ith smallest element in the tree, and Rank(x), which finds the rank of element x in the tree.

Directories

Path Synopsis
Package avl provides the implementation for an AVL tree, which satisfies the ost package interfaces, as well as the order package interfaces.
Package avl provides the implementation for an AVL tree, which satisfies the ost package interfaces, as well as the order package interfaces.
Package rb provides the implementation for a red black tree, which satisfies the ost package interfaces, as well as the order package interfaces.
Package rb provides the implementation for a red black tree, which satisfies the ost package interfaces, as well as the order package interfaces.

Jump to

Keyboard shortcuts

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