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

x/blocks/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/blocks@1.101.13/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