Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a SortedDictionary automatically sorted?

Tags:

c#

I have never used a SortedDictionary and was just curious if when you add values to it, for example, in a for loop, do the values get sorted automatically when you add them or do you have to sort them after you add them.

like image 474
Xaisoft Avatar asked Jan 26 '26 21:01

Xaisoft


1 Answers

It's done automatically. The dictionary is structured in such a way that it must be sorted to operate correctly.

like image 68
bdukes Avatar answered Jan 29 '26 12:01

bdukes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!