SortedList<>, SortedDictionary<> and Dictionary<>

前端 未结 6 782
臣服心动
臣服心动 2020-11-28 02:58

I find that SortedList SortedDictionary and Dictionary implement the same

6条回答
  •  无人及你
    2020-11-28 03:08

    enter image description here

    I'd mention difference between dictionaries.

    Above picture shows that Dictionary is equal or faster in every case than Sorted analog, but if order of elements is required, e.g. to print them, Sorted one is chosen.

    Src: http://people.cs.aau.dk/~normark/oop-csharp/html/notes/collections-note-time-complexity-dictionaries.html

提交回复
热议问题