Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 753545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:54:36+00:00 2026-05-14T14:54:36+00:00

MSDN has no information on the order preserving properties of data structures. So I’ve

  • 0

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 (i.e. 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?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:54:36+00:00Added an answer on May 14, 2026 at 2:54 pm

    You should NOT expect either the keys or values in a regular Dictionary<TKey,TValue> to be maintained in any order. In a SortedDictionary<TKey,TValue> the keys and values are maintained in order by the value of the key – this is not the same as insertion order.

    The only built-in dictionary in the .NET framework that preserves insertion order is System.Collections.Specialized.OrderedDictionary. Unfortunately, this class is not generic – however, it’s not terribly hard to write a generic wrapper around it. Keep in mind, when dealing with value types (like int or double) it will result in boxing of the keys/values (generic dictionaries don’t impose boxing on value types).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A similar question has been asked: MSDN subscriptions on the cheap? , but I
I've tried searching through search engines,MSDN,etc. but can't anything. Sorry if this has been
I'm curious if there is anyone around here that has inside information on the
As with most legacy MSDN pages, the page for ReportEvent has too little information
I'm working with Microsoft Team Foundation Server and MSDN has been fantastic so far
It has been about a year since I wrote any .dll plugins that use
according to MSDN, Visual Studio uses a special heap in debug mode that has
I'm working on creating an app that will parse MSDN articles for meta-information such
MSDN has the functionality I'm looking for here . Since microsoft recognizes the usefulness
Here's what MSDN has to say under When to Use Static Classes : static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.