SortedList<TKey,TValue> 和 SortedDictionary<TKey,TValue>

简介:

The 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>.

 

欢迎转载,转载请注明:

转载自 胡庆访http://zgynhqf.cnblogs.com/ ]

目录
相关文章
|
4月前
|
Java 容器 Spring
DefaultListableBeanFactory
DefaultListableBeanFactory 是一个完整的、功能成熟的 IoC 容器,如果你的需求很简单,甚至可以直接使用 DefaultListableBeanFactory,如果你的需求比较复杂,那么通过扩展 DefaultListableBeanFactory 的功能也可以达到,可以说 DefaultListableBeanFactory 是整个 Spring IoC 容器的始祖。
|
1月前
|
机器学习/深度学习 监控 数据可视化
Ultralytics是什么?
【8月更文挑战第3天】Ultralytics是什么?
61 0
|
存储 Java 索引
Nullable
Nullable
87 0
|
Serverless 程序员 云计算
Serverful
Serverful
169 0
Helpful Maths
Helpful Maths
111 0
Helpful Maths
@NotNull、@NotEmpty、@NotBlank的区别
@NotNull、@NotEmpty、@NotBlank的区别
251 0
|
Windows
CurrentCulture和CurrentUICulture的区别
1.CurrentCulture:這個Property是用來定義使用者要使用的"地區選項"、標準及格式等等的資料。 2.CurrentUICulture:顧名思義,這個Property是用在定義使用者登入系統的時候所使用的語言,例如在MUI(Multi-language User Interface)中,您可以定義您看到桌面上顯現給您的語言。
1641 0
TargetNullValue与FallbackValue
原文:TargetNullValue与FallbackValue TargetNullValue与FallbackValue都是BindingBase的属性。  TargetNullValue:获取或设置当源的值为 nullNothingnullptrunitnull 引用(在 Visual Basic 中为 Nothing) 时在目标中使用的值。
959 0