You are here: Symbol Reference > AbstractMtxVecInt Namespace > Classes > TMtxVecInt Class > public > BinarySearch Method > TMtxVecInt.BinarySearch Method (Integer)
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtxVecInt.BinarySearch Method (Integer)

Finds a match for X in object values using binary search.

Pascal
function BinarySearch(const X: Integer): Integer; overload;

the index of last matched element. If no matching elements are found, the result is -1.

The data in the vector must be sorted in ascending order for this function to work correctly.

Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!