c# - Best way to find out distinct item in the big list -


i have following collection, has more 500000 items in it.

list<item> mycollection = new list<item>(); 

and type:

class item {    public string name { get; set; }    public string description { get; set; } } 

i want return list of items having distinct name. i.e. find out distinct item based on name.

what possible ways & best in terms of time & memory. although both important less time has more priority on memory.

you can sort list delete repeated items, seems storing data in dictionary<string, string> better task. or maybe put list in hashset.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -