rank_paring

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPHeap

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

RPHeap is an implementation of a rank Pairing Heap. The zero value for RPHeap Root is an empty Heap.

func New

func New() *RPHeap

New returns an initialized rankPairingHeap.

func (*RPHeap) Adjust

func (r *RPHeap) Adjust(old, new heap.Item) heap.Item

Adjust the value of an item, since we have to find the item Complexity is O(n)

func (*RPHeap) Clear

func (r *RPHeap) Clear()

Clear the whole rankPairingHeap

func (*RPHeap) Delete

func (r *RPHeap) Delete(val heap.Item) heap.Item

Delete an item from the heap Complexity is O(n)

func (*RPHeap) DeleteMin

func (r *RPHeap) DeleteMin() heap.Item

DeleteMin removes the top most value from the rankPairingHeap and returns it Complexity: O(log n)

func (*RPHeap) FindMin

func (r *RPHeap) FindMin() heap.Item

FindMin returns the value of root Complexity: O(1)

func (*RPHeap) Init

func (p *RPHeap) Init() *RPHeap

Init initializes or clears the rankPairingHeap

func (*RPHeap) Insert

func (r *RPHeap) Insert(val heap.Item) heap.Item

Insert the value val into the heap and return it Complexity: O(1)

func (*RPHeap) Meld

func (r *RPHeap) Meld(a heap.Interface) heap.Interface

Merge a rankPairingHeap r0 into a heap r, then clear r0 Complexity: O(1)

func (*RPHeap) Size

func (r *RPHeap) Size() int

Size returns the size of the RPHeap

Jump to

Keyboard shortcuts

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