Home Manual Reference Source

Function

Static Public Summary
public

firstInversion(compare: Function, array: ArrayLike, left: number, right: number): number

Returns k <= right such that [left,k[ is sorted.

public

isSorted(compare: Function, array: ArrayLike, left: number, right: number): boolean

Returns whether range [left,right[ of array is sorted.

Static Public

public firstInversion(compare: Function, array: ArrayLike, left: number, right: number): number source

Returns k <= right such that [left,k[ is sorted. If k < right, then compare( array[k-1] , array[k] ) > 0.

Params:

NameTypeAttributeDescription
compare Function
array ArrayLike
left number
right number

Return:

number

public isSorted(compare: Function, array: ArrayLike, left: number, right: number): boolean source

Returns whether range [left,right[ of array is sorted.

Params:

NameTypeAttributeDescription
compare Function
array ArrayLike
left number
right number

Return:

boolean