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
Post a Comment