heaps

package
v0.0.0-...-7253c86 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KClosestPointsToOrigin

func KClosestPointsToOrigin(points [][]int, k int) [][]int

func LastStoneWeight

func LastStoneWeight(stones []int) int

func TaskScheduler

func TaskScheduler(tasks []byte, n int) int

Types

type IntHeap

type IntHeap []int

func (IntHeap) Len

func (h IntHeap) Len() int

func (IntHeap) Less

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

func (*IntHeap) Pop

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

func (*IntHeap) Push

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

func (IntHeap) Swap

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

type KthLargest

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

func KthLargestConstructor

func KthLargestConstructor(k int, nums []int) KthLargest

func (*KthLargest) Add

func (this *KthLargest) Add(val int) int

type MedianFinder

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

func MedianFinderConstructor

func MedianFinderConstructor() MedianFinder

func (*MedianFinder) AddNum

func (this *MedianFinder) AddNum(num int)

func (*MedianFinder) FindMedian

func (this *MedianFinder) FindMedian() float64

Jump to

Keyboard shortcuts

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