leet_895

package
v0.0.0-...-9cc4e77 Latest Latest
Warning

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

Go to latest
Published: May 14, 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 FreqStack

type FreqStack struct {
	Top       int
	PriorityQ *MyHeap
	Index     map[int]*MapElem
}

func Constructor

func Constructor() FreqStack

func (*FreqStack) Pop

func (this *FreqStack) Pop() int

func (*FreqStack) Push

func (this *FreqStack) Push(x int)

type HeapElem

type HeapElem struct {
	Val  int
	Freq int
	Pos  int
	Idx  int
}

type MapElem

type MapElem struct {
	Pos  []int
	Elem *HeapElem
}

func (*MapElem) GetTop

func (m *MapElem) GetTop() int

type MyHeap

type MyHeap []*HeapElem

func (MyHeap) Len

func (h MyHeap) Len() int

func (MyHeap) Less

func (h MyHeap) Less(i, j int) bool

func (*MyHeap) Pop

func (h *MyHeap) Pop() interface{}

func (*MyHeap) Push

func (h *MyHeap) Push(x interface{})

func (MyHeap) Swap

func (h MyHeap) Swap(i, j int)

Jump to

Keyboard shortcuts

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