Constructors
constructor
- new BinarySearch(array: T[], predicate: function): BinarySearch
-
Parameters
-
array: T[]
-
predicate: function
-
-
Parameters
Returns number
Methods
findFirstIndex
- findFirstIndex(key: number, start?: number, end?: number): number
-
Parameters
-
key: number
-
Default value start: number = 0
-
Default value end: number = (this.array.length - 1)
Returns number
findLastIndex
- findLastIndex(key: number, start?: number, end?: number): number
-
Parameters
-
key: number
-
Default value start: number = 0
-
Default value end: number = (this.array.length - 1)
Returns number
Util class with binary search procedures Assumes that array is in ascending order according to predicate