SortedList<TKey,TValue> 和 SortedDictionary<TKey,TValue>
2009-12-18 13:40
489 查看
The
3.If the list is populated all at once from sorted data,
SortedList<TKey, TValue>generic class is a binary search tree with O(log n) retrieval, where n is the number of elements in the dictionary. In this, it is similar to the
SortedDictionary<TKey, TValue>generic class. The two classes have similar object models, and both have O(log n) retrieval. Where the two classes differ is in memory use and speed of insertion and removal:
1.SortedList<TKey, TValue>uses less memory than
SortedDictionary<TKey, TValue>.
2.SortedDictionary<TKey, TValue>has faster insertion and removal operations for unsorted data, O(log n) as opposed to O(n) for
SortedList<TKey, TValue>.
3.If the list is populated all at once from sorted data,
SortedList<TKey, TValue>is faster than
SortedDictionary<TKey, TValue>.
相关文章推荐
- 泛型与非泛型集合类的区别及使用例程,包括ArrayList,Hashtable,List<T>,Dictionary<Tkey,Tvalue>,SortedList<Tkey,Tvalue>,Queu
- [C#]泛型与非泛型集合类的区别及使用例程,包括ArrayList,Hashtable,List<T>,Dictionary<Tkey,Tvalue>,SortedList<Tkey,Tvalue>,Queue<T>,Stack<T>等
- .net学习笔记----有序集合SortedList、SortedList<TKey,TValue>、SortedDictionary<TKey,TValue>
- 字典---有序字典(SortedDictionary<TKey,TValue>)
- C#学习常用类--SortedDictionary<TKey,TValue>类
- .Net集合类的研究-有序集合(二)-SortedDictionary<TKey,TValue>
- 有序列表---SortedList<TKey,TValue>
- c# 图解泛型List<T>, HashTable和Dictionary<TKey,TValue>
- SortedDictionary<TKey,TValue>正序与反序排序
- C# SortedDictionary<TKey,TValue>排序 用法 Sort()用法
- .Net集合类的研究-有序集合(一)-SortedList、SortedList<TKey,TValue>
- C# 谈Dictionary<TKey,TValue>,SortedDictionary<TKey,TValue>排序
- [C#]泛型与非泛型集合类的区别及使用例程,包括ArrayList,Hashtable,List<T>,Dictionary<Tkey,Tvalue>,SortedList<Tkey,Tvalue>,
- 对IEnumerable<T>,IDictionary<Tkey,TValue>,ICollection<T>,IList<T>的总结
- .net框架-字典对象 Hashtable & Dictionary<TKey,TValue> & SortedList
- C# 字典 Dictionary<Tkey,Tvalue>
- .Net 中HashTable,HashMap 和 Dictionary<key,value> 和List<T>和DataTable的比较
- C#泛型集合类介绍之Dictionary<TKey,TValue>(转载)
- Unity中JsonUtility对List<T>和Dictionary<Key,Value>的序列化
- C#学习常用类(1003)---ConcurrentDictionary<TKey,TValue>