SortedSet<T>.IntersectWith(IEnumerable<T>) 方法

定義

修改目前的 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> 物件比較的集合。

實作

例外狀況

othernull

備註

這個方法會忽略 中 other任何重複的專案。

如果 參數所表示的 other 集合是 SortedSet<T> 與目前 SortedSet<T> 物件相同的相等比較子集合,則這個方法是 O(n) 作業。 否則,這個方法是 O(n + m) 作業,其中 nCount ,而 m 是中的 other項目數目。

適用於