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 |
Returns whether range [left,right[ of array is sorted. |
Static Public
public firstInversion(compare: Function, array: ArrayLike, left: number, right: number): number source
import firstInversion from '@comparison-sorting/is-sorted/src/firstInversion.js'
Returns k <= right such that [left,k[ is sorted. If k < right, then compare( array[k-1] , array[k] ) > 0.