leftist

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LeftistHeap

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

LeftistHeap is a leftist heap implementation.

func New

func New() *LeftistHeap

New returns an initialized LeftistHeap.

func (*LeftistHeap) Clear

func (h *LeftistHeap) Clear()

Clear removes all items from the heap.

func (*LeftistHeap) DeleteMin

func (h *LeftistHeap) DeleteMin() heap.Item

DeleteMin deletes the minimum value and returns it. The complexity is O(log n) amortized.

func (*LeftistHeap) FindMin

func (h *LeftistHeap) FindMin() heap.Item

FindMin finds the minimum value. The complexity is O(1).

func (*LeftistHeap) Init

func (h *LeftistHeap) Init() *LeftistHeap

Init initializes or clears the LeftistHeap

func (*LeftistHeap) Insert

func (h *LeftistHeap) Insert(item heap.Item) heap.Item

Insert adds an item into the heap. The complexity is O(log n) amortized.

type Node

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

Node is a leaf in the heap.

Jump to

Keyboard shortcuts

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