_295_find_median_from_data_stream

package
v0.0.0-...-4cd11fd Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heap

type Heap struct {
	Values   []int
	LessFunc func(int, int) bool
}

func NewHeap

func NewHeap(less func(int, int) bool) *Heap

func (*Heap) Len

func (h *Heap) Len() int

func (*Heap) Less

func (h *Heap) Less(i, j int) bool

func (*Heap) Peek

func (h *Heap) Peek() int

func (*Heap) Pop

func (h *Heap) Pop() (v interface{})

func (*Heap) Push

func (h *Heap) Push(v interface{})

func (*Heap) Swap

func (h *Heap) Swap(i, j int)

type MedianFinder

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

func Constructor

func Constructor() MedianFinder

func (*MedianFinder) AddNum

func (mf *MedianFinder) AddNum(num int)

func (*MedianFinder) FindMedian

func (mf *MedianFinder) FindMedian() float64

Jump to

Keyboard shortcuts

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