Overload List
| # | Signature | Description |
|---|---|---|
| 1 | Int32 BinarySearch(Int32 X) | Finds a match for X in object values using binary search. |
| 2 | Boolean BinarySearch(Int32 X, ref Int32 XIndex) | Finds a closest match for X in object values using binary search. |
Overload 1: Int32 BinarySearch(Int32 X)
Finds a match for X in object values using binary search.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Int32 |
Returns: Int32 - the index of first matched element. If no matching elements are found, the result is -1.
Remarks:
The data in the vector must be sorted in ascending order for this function to work correctly.
Overload 2: Boolean BinarySearch(Int32 X, ref Int32 XIndex)
Finds a closest match for X in object values using binary search.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Int32 | |
| 2 | XIndex | Int32 (ref) | X start index |
Returns: Boolean - True, if found and the index of the closest match in XIndex.
Remarks:
The data in the vector must be sorted in ascending order for this function to work correctly.