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/ ]

目录
相关文章
|
3月前
|
Java 容器 Spring
DefaultListableBeanFactory
DefaultListableBeanFactory 是一个完整的、功能成熟的 IoC 容器,如果你的需求很简单,甚至可以直接使用 DefaultListableBeanFactory,如果你的需求比较复杂,那么通过扩展 DefaultListableBeanFactory 的功能也可以达到,可以说 DefaultListableBeanFactory 是整个 Spring IoC 容器的始祖。
|
22天前
|
SQL 安全 Java
resultMap 与 resultType、parameterMap 与 parameterType的区别
resultMap 与 resultType、parameterMap 与 parameterType的区别
35 0
|
10月前
【ULP】什么是ULP
【ULP】什么是ULP
242 0
|
存储 Java 索引
Nullable
Nullable
63 0
|
SQL Java 数据库连接
ResultMap与ResultType的区别
ResultMap与ResultType的区别
ResultMap与ResultType的区别
@NotNull、@NotEmpty、@NotBlank的区别
@NotNull、@NotEmpty、@NotBlank的区别
220 0
TargetNullValue与FallbackValue
原文:TargetNullValue与FallbackValue TargetNullValue与FallbackValue都是BindingBase的属性。  TargetNullValue:获取或设置当源的值为 nullNothingnullptrunitnull 引用(在 Visual Basic 中为 Nothing) 时在目标中使用的值。
936 0
|
Python 机器学习/深度学习 安全