ts-ds / upperBound
Function: upperBound()
ts
function upperBound<T>(
array,
target,
compareFn?
): number;Defined in: search/search.ts:58
Index of the first element that is greater than target in a sorted array. upperBound − lowerBound is the number of elements equal to target.
Type Parameters
| Type Parameter | Description |
|---|---|
T |
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
array | readonly T[] | undefined | Array sorted in the order of compareFn. |
target | T | undefined | Value to look for. |
compareFn? | CompareFn<T> | defaultCompare | Order of the array. |
Returns
number
From 0 to array.length.