datatype

package
v0.0.0-...-5935107 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Index int // The index of the item in the heap.
	// contains filtered or unexported fields
}

An Item is something we manage in a priority queue.

func (*Item) GetPriority

func (i *Item) GetPriority() int

func (*Item) GetValue

func (i *Item) GetValue() interface{}

func (*Item) SetPriority

func (i *Item) SetPriority(priority int)

func (*Item) SetValue

func (i *Item) SetValue(value interface{})

type PriorityQueue

type PriorityQueue []*Item

A PriorityQueue implements heap.Interface and holds Items.

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

func (*PriorityQueue) PrintQueue

func (pq *PriorityQueue) PrintQueue()

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x interface{})

func (*PriorityQueue) SetNodeValue

func (pq *PriorityQueue) SetNodeValue(item *Item, value interface{})

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

func (*PriorityQueue) Update

func (pq *PriorityQueue) Update(item *Item, value interface{}, priority int)

update modifies the priority and value of an Item in the queue.

Jump to

Keyboard shortcuts

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