据我所知,列表、排序列表和数组列表有很多共同点,但同时也有一些不同之处。
我想知道:初学者应该知道的它们之间的区别是什么?为什么选择一个而不是另一个?在代码中使用它们时要养成哪些好习惯?
感谢您的宝贵时间。
最佳答案
来自 MSDN:
A SortedList element can be accessed by its key, like an element in any IDictionary implementation, or by its index, like an element in any IList implementation.
A SortedList object internally maintains two arrays to store the elements of the list; that is, one array for the keys and another array for the associated values. Each element is a key/value pair that can be accessed as a DictionaryEntry object. A key cannot be null, but a value can be.
还有选择最好的收藏你可以看到this .
关于c# - 列表、排序列表和数组列表之间有什么区别? (C#),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33406640/