平衡的树状数据结构调整为主要尺寸 [英] balanced tree-like data structure that resizes to prime sizes

查看:137
本文介绍了平衡的树状数据结构调整为主要尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关这一点:堆栈溢出问题

在那里我发现净字典调整为下一任的大小是至少两倍于目前的规模,我想知道是否有可以调整为黄金尺寸(类似B-任何平衡的树状数据结构树或二叉树可能)。

where I found out that .Net dictionaries resize to the next prime size that is at least twice the current size, I was wondering if there is any balanced tree-like data structure that can resize to prime sizes (similar to B-Trees or Binomial trees maybe).

的后面是什么。NET的词典树形数据结构?

What is the tree-like data structure behind .Net's dictionaries?

感谢。

推荐答案

词典使用哈希表算法,其存储在一个阵列中的数据,它是这个数组,其尺寸/重新尺寸基于素数。

The Dictionary uses a hash table algorithm, which stores the data in an array, it is this array that is sized/re-sized based on Prime numbers.

.NET SortedDictionary 使用< A HREF =htt​​p://en.wikipedia.org/wiki/Red-black_tree相对=nofollow>红黑树结构,保键/值对。由于红黑树没有被存储在一个固定的阵列,而是作为一系列的上带左/右子节点的节点,所以没有真正上浆任何的一个概念,作为节点添加到树转动到树维持平衡。

.NET SortedDictionary uses a Red-Black tree structure to maintain the Key/Value pairs. Since the red-black tree is not stored in a fixed array, but rather as a series on nodes with left/right child nodes, there is not really a concept of sizing anything, as nodes are added to the tree the tree is rotated to maintain the balance.

这篇关于平衡的树状数据结构调整为主要尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆