treap

package
v0.0.0-...-88e3535 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxInt = int(^uint(0) >> 1)

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Priority    goheap.Integer
	Key         goheap.Item
	Left, Right *Node
}

type Treap

type Treap struct {
	Root *Node
}

Treap implementation.

func New

func New() *Treap

New returns an initialized Treap.

func (*Treap) Clear

func (h *Treap) Clear()

Clear removes all items from the heap.

func (*Treap) DeleteMin

func (h *Treap) DeleteMin() goheap.Item

DeleteMin deletes the minimum value and returns it.

func (*Treap) FindMin

func (h *Treap) FindMin() goheap.Item

FindMin finds the minimum value.

func (*Treap) Init

func (h *Treap) Init() *Treap

Init initializes or clears the Treap

func (*Treap) Insert

func (h *Treap) Insert(v goheap.Item) goheap.Item

Insert adds an item into the heap.

Jump to

Keyboard shortcuts

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