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