Thursday, November 25, 2010

HashSet VS SortedSet

Today I come across a good article explaining the difference between HashSet VS SortedSet collections in .net

Below is the link of original article
http://msdn.microsoft.com/en-us/vcsharp/ee906600.aspx

The .NET 4.0 library includes an additional collection class: The SortedSet.
SortedSet will typically be faster than HashSet when the majority of your operations require enumerating the set in one particular order. If, instead, most of the operations are searching, you’ll find better performance using the HashSet. The frequency of insert operations also has an effect on which collection would be better. The more frequently insert operations occur, the more likely HashSet will be faster.

No comments: