简体   繁体   中英

The Big O of Distinct() method with a Custom IEqualityComparer

谁知道使用自定义IEqualityComparerDistinct()方法中使用的算法的Big O吗?

There's an equal question here on SO about " What guarantees are there on the run-time complexity (Big-O) of LINQ methods? "

See this section in the answer about distinct:

Distinct, GroupBy Join, and I believe also the set-aggregation methods (Union, Intersect and Except) use hashing, so they should be close to O(N) instead of O(N²).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM