SortedList<TKey,TValue>.IndexOfKey(TKey) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Searches for the specified key and returns the zero-based index within the entire SortedList<TKey,TValue>.
public:
int IndexOfKey(TKey key);
public int IndexOfKey (TKey key);
member this.IndexOfKey : 'Key -> int
Public Function IndexOfKey (key As TKey) As Integer
Parameters
- key
- TKey
The key to locate in the SortedList<TKey,TValue>.
Returns
The zero-based index of key
within the entire SortedList<TKey,TValue>, if found; otherwise, -1.
Exceptions
key
is null
.
Remarks
This method performs a binary search; therefore, this method is an O(log n
) operation, where n
is Count.
Applies to
See also
GitHub पर हमारे साथ सहयोग करें
इस सामग्री का स्रोत GitHub पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.