utils

package
v0.0.0-...-d3fc627 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2020 License: MIT, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MaxHeap

type MaxHeap struct {
	Element []int
}

func NewMaxHeap

func NewMaxHeap() *MaxHeap

MaxHeap constructor

func (*MaxHeap) DeleteMax

func (H *MaxHeap) DeleteMax() (int, error)

Delete and return the Maximum

func (*MaxHeap) GetMax

func (H *MaxHeap) GetMax() int

Get the Maximum of the Maxheap

func (*MaxHeap) Insert

func (H *MaxHeap) Insert(v int)

Inserting items requires ensuring the nature of the Maxheap

func (*MaxHeap) Length

func (H *MaxHeap) Length() int

Length of Maxheap

func (*MaxHeap) Max

func (H *MaxHeap) Max() (int, error)

Get the Maximum of the Maxheap

type MinHeap

type MinHeap struct {
	Element []int
}

func NewMinHeap

func NewMinHeap() *MinHeap

MinHeap constructor

func (*MinHeap) DeleteMin

func (H *MinHeap) DeleteMin() (int, error)

Delete and return the Minimum

func (*MinHeap) GetMin

func (H *MinHeap) GetMin() int

Get the Minimum of the Minheap

func (*MinHeap) Insert

func (H *MinHeap) Insert(v int)

Inserting items requires ensuring the nature of the Minheap

func (*MinHeap) Length

func (H *MinHeap) Length() int

Length of Minheap

func (*MinHeap) Min

func (H *MinHeap) Min() (int, error)

Get the Minimum of the Minheap

type Stack

type Stack []interface{}

func (Stack) Cap

func (stack Stack) Cap() int

func (Stack) IsEmpty

func (stack Stack) IsEmpty() bool

func (Stack) Len

func (stack Stack) Len() int

func (*Stack) Pop

func (stack *Stack) Pop() (interface{}, error)

func (*Stack) Push

func (stack *Stack) Push(value interface{})

func (Stack) Top

func (stack Stack) Top() (interface{}, error)

Jump to

Keyboard shortcuts

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