SortedSet<T>.IntersectWith(IEnumerable<T>) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
修改目前 SortedSet<T> 物件,使其只包含同時屬於指定集合的元素。
public:
virtual void IntersectWith(System::Collections::Generic::IEnumerable<T> ^ other);
public virtual void IntersectWith(System.Collections.Generic.IEnumerable<T> other);
abstract member IntersectWith : seq<'T> -> unit
override this.IntersectWith : seq<'T> -> unit
Public Overridable Sub IntersectWith (other As IEnumerable(Of T))
參數
- other
- IEnumerable<T>
將收藏與當前 SortedSet<T> 物件做比較。
實作
例外狀況
other 是 null。
備註
此方法忽略 中任何重複元素。other
若參數所代表other的集合與當前SortedSet<T>物件具有相同的等號比較器,SortedSet<T>則此方法即為操作O(n)。 否則,此方法是一個 O(n + m) 運算,其中 n 是 Count ,是 m 中 other元素的數量。