Home Manual Reference Source

Function

Static Public Summary
public

firstInversion(compare: Function, array: ArrayLike, left: number, right: number, pivots: number[], pi: number, pj: number): number

Checks whether range [left,right[ of array is partitioned according to pivot p.

public

hoare(compare: Function, a: Array, i: number, j: number): number

public

isPartitioned(compare: Function, array: ArrayLike, left: number, right: number, pivots: number[], pi: number, pj: number): boolean

Checks whether range [left,right[ of array is partitioned according to pivot p.

public

lomuto(compare: Function, a: Array, i: number, j: number): number

public

whole(partition: *)

public

yaroslavskiy(compare: Function, a: Array, i: number, j: number): [number, number]

Static Public

public firstInversion(compare: Function, array: ArrayLike, left: number, right: number, pivots: number[], pi: number, pj: number): number source

Checks whether range [left,right[ of array is partitioned according to pivot p. Returns the index of the first inversion.

Params:

NameTypeAttributeDescription
compare Function
array ArrayLike
left number
right number
pivots number[]
pi number
pj number

Return:

number

public hoare(compare: Function, a: Array, i: number, j: number): number source

Params:

NameTypeAttributeDescription
compare Function
a Array
i number
j number

Return:

number

public isPartitioned(compare: Function, array: ArrayLike, left: number, right: number, pivots: number[], pi: number, pj: number): boolean source

Checks whether range [left,right[ of array is partitioned according to pivot p.

Params:

NameTypeAttributeDescription
compare Function
array ArrayLike
left number
right number
pivots number[]
pi number
pj number

Return:

boolean

public lomuto(compare: Function, a: Array, i: number, j: number): number source

Params:

NameTypeAttributeDescription
compare Function
a Array
i number
j number

Return:

number

public whole(partition: *) source

Params:

NameTypeAttributeDescription
partition *

public yaroslavskiy(compare: Function, a: Array, i: number, j: number): [number, number] source

See http://cs.stackexchange.com/a/24099/20711

Params:

NameTypeAttributeDescription
compare Function
a Array
i number
j number

Return:

[number, number]