c# order preserving data structures

Posted by Oren Mazor on Stack Overflow See other posts from Stack Overflow or by Oren Mazor
Published on 2010-04-27T15:55:03Z Indexed on 2010/04/27 16:03 UTC
Read the original article Hit count: 421

Filed under:
|

Oddly enough, MSDN has no information on the order preserving properties of data structures. So I've been making the assumption that:

  • Hashtable and Hashset do not preserve the insertion order (aka the "hash" in there is a giveaway)
  • Dictionary and List DO preserve the insertion order.

from this I extrapolate that if I have a Dictionary<double,double> foo that defines a curve, foo.Keys.ToList() and foo.Values.ToList() will give me an ordered list of the scope and domain of that curve without messing about with it?

© Stack Overflow or respective owner

Related posts about c#

Related posts about data-structures