c# fastest way to find item in list

89

c# fastest way to find item in list -

If your goal is just to make it very fast to find the
strings in a collection, put them into a HashSet.

HashSet.Contains is an O(1) method, and strings have a
good hash algorithm by default, so it will be difficult
to make a faster routine than this.

Comments

Submit
0 Comments