Skip to main content
Module

x/simplestatistics/src/max_sorted.js>default

simple statistics for node & browser javascript
Latest
function default
import { default } from "https://deno.land/x/simplestatistics@v7.8.3/src/max_sorted.js";

The maximum is the highest number in the array. With a sorted array, the last element in the array is always the largest, so this calculation can be done in one step, or constant time.

Examples

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

Parameters

x

input