C# associative array

后端 未结 10 2174
时光取名叫无心
时光取名叫无心 2020-12-11 00:12

I\'ve been using a Hashtable, but by nature, hashtables are not ordered, and I need to keep everything in order as I add them (because I want to pull them out in the same or

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-11 00:48

    One alternative is to keep your ordered key values in an ordered structure like a List, the rest being still stored in a dictionnary.

    Then, when you need to access your data, just go through your sorted List and query your dictionnary along the way.

提交回复
热议问题