Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/live/utils/stat.ts>Median

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Go to Latest
class Median
import { Median } from "https://deno.land/x/live@1.104.0/utils/stat.ts";

Constructors

new
Median(maxSize?: number)

Properties

private
maxHeap: MaxHeap
private
minHeap: MinHeap
private
removeCount: { [key: number]: number; }
private
values: number[]

Methods

private
addValue(value: number): void
private
calculateMedian(): number
private
removeValue(value: number): void
add(value: number): void
get(): number