redblacktree

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 4 Imported by: 0

README

redblacktree

a thread safe red-black-tree based on github.com/emirpasic/gods/trees/redblacktree

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator added in v1.0.1

type Iterator interface {
	Next() bool
	Key() interface{}
	Values() []Value
}

Iterator a stateful iterator whose elements are key/value pairs.

type Tree

type Tree interface {
	Put(key interface{}, value Value)
	Get(key interface{}) (values []Value, found bool)
	Remove(key interface{})
	Empty() bool
	Size() int
	Min() (key interface{}, values []Value)
	PopMin() (key interface{}, values []Value)
	Max() (key interface{}, values []Value)
	PopMax() (key interface{}, values []Value)
	Topology() string
	Iterator() Iterator
}

Tree supported methods on red-black-tree

func New

func New(comparator utils.Comparator) (Tree, error)

New create a thread safe red-black-tree based on github.com/emirpasic/gods/trees/redblacktree

type Value

type Value = pkg.Value

Value if the value.id is duplicated, it will be ignored.

Directories

Path Synopsis
internal
pkg
Package redblacktree implements a red-black tree.
Package redblacktree implements a red-black tree.

Jump to

Keyboard shortcuts

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