Skip to main content
Module

x/statistics/mod.ts>minSorted

Deno basic statistics module.
Latest
function minSorted
import { minSorted } from "https://deno.land/x/statistics@v0.1.1/mod.ts";

The minimum is the lowest number in the sorted array. With a sorted array, the first element in the array is always the smallest, so this calculation can be done in one step, or constant time.

Examples

minSorted([-100, -10, 1, 2, 5]); // => -100

Parameters

x: number[]

input

Returns

number

minimum value