LinkedList<T>.Find(T) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
尋找包含指定值的第一個節點。
public:
System::Collections::Generic::LinkedListNode<T> ^ Find(T value);
public System.Collections.Generic.LinkedListNode<T> Find(T value);
public System.Collections.Generic.LinkedListNode<T>? Find(T value);
member this.Find : 'T -> System.Collections.Generic.LinkedListNode<'T>
Public Function Find (value As T) As LinkedListNode(Of T)
參數
- value
- T
該值在 中定位 LinkedList<T>。
傳回
第一個 LinkedListNode<T> 包含指定值的(若找到);否則,為 null。
範例
關於包含此方法的範例,請參見該 LinkedList<T> 類別。
備註
LinkedList<T>從 開始First向前搜尋,直到 Last。
此方法執行線性搜尋;因此,此方法是一個 O(n) 運算,其中 n 為 Count。