- ICollection<T>
- IEqualityComparable<T>
- IComparable<T>
- IComparer<T>
- IEqualityComparer<T>
- IList<T>
- IMap<TKey,TValue>
- ISet<T>
- CDefaultComparer<T>
- CDefaultEqualityComparer<T>
- CRedBlackTreeNode<T>
- CLinkedListNode<T>
- CKeyValuePair<TKey,TValue>
- CArrayList<T>
- CHashMap<TKey,TValue>
- CHashSet<T>
- CLinkedList<T>
- CQueue<T>
- CRedBlackTree<T>
- CSortedMap<TKey, TValue>
- CSortedSet<T>
- CStack<T>
- ArrayBinarySearch<T>
- ArrayIndexOf<T>
- ArrayLastIndexOf<T>
- ArrayReverse<T>
- Compare
- Equals<T>
- GetHashCode
ArrayBinarySearch
使用IComparable<T>接口,搜索升序一维数组指定值来比较元素。
template<typename T>
|
参数
&array[]
[out] 要搜索的数组。
value
[in] 已搜索的值。
*comparer
[in] 接口用于比较元素。
start_index
[in] 搜索开始的索引起始点。
count
[in] 搜索范围长度。
返回值
返回找到元素的索引。如果搜索值未找到,它将返回最接近值的最小元素的索引。