0

Which one of the folowing is efficient way to store list of objects?

Hashset<object> listOfObjects = new HashSet<object>();

or

List<object>listOfObjects = new List<object>();
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
  • Efficient in what way? Searching? Iterating? Sorting? Inserting? Note that `List` can contain duplicates, `Hashset` can't. – D Stanley May 29 '15 at 13:47
  • Why don't you test for yourself what's better in your use case? [Eric Lippert on performance measuring](http://ericlippert.com/2012/12/17/performance-rant/) – germi May 29 '15 at 13:48
  • Thanks for the feedback. Basically I am trying to implement path planning algorithm and I want this for storing the information about the nodes. – Tesfaye Asmera May 29 '15 at 13:58

0 Answers0