queue

package
v0.0.0-...-bced520 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxSlidingWindow

func MaxSlidingWindow(nums []int, k int) []int

MaxSlidingWindow return max value in sliding window which size is k. Each time the sliding window moves right by one position

Types

type PriorityQueue

type PriorityQueue struct {
	sort.IntSlice
	// contains filtered or unexported fields
}

func NewPriorityQueue

func NewPriorityQueue(elems []int, size int) *PriorityQueue

func (*PriorityQueue) Less

func (p *PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

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

func (*PriorityQueue) Push

func (p *PriorityQueue) Push(v interface{})

Jump to

Keyboard shortcuts

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