Functions
find_if
-
Parameters
Returns number
is_sorted
- is_sorted(array: any[]): number
-
Parameters
Returns number
max_element
- max_element(a: number[]): number
-
Parameters
Returns number
min_element
- min_element(a: number[]): number
-
Parameters
Returns number
partial_sort
- partial_sort(a: any[], first: number, middle: number, last: number, comp: BinaryFunction<any, any, number>): void
-
Parameters
-
a: any[]
-
first: number
-
middle: number
-
last: number
-
Returns void
random_shuffle
- random_shuffle(array: any[]): void
-
Parameters
Returns void
remove
- remove(a: any[], v: any): any[]
-
Parameters
Returns any[]
reverse
- reverse(array: number[], start?: number, stop?: number): void
-
Parameters
-
array: number[]
-
Default value start: number = 0
-
Default value stop: number = -1
Returns void
swap
- swap(a: any, b: any): void
-
Parameters
Returns void
unique
- unique(a: number[]): number[]
-
Parameters
Returns number[]
unique1
-
Parameters
Returns any[]
check if array is sorted
is_sorted([0, 1, 2, 2]); // 1 is_sorted([4, 3, 2]); // -1 is_sorted([4, 3, 5]); // 0