静态搜索树应该是不平衡的吗?
Should Static Search Trees Ever Be Unbalanced?
摘要:
在本文中,我们研究的问题是否静态搜索树应该是不平衡的。我们提出了几种方法来重建一个不平衡的k元搜索树$T$到一个新的树$R$,保留了$T$的许多属性,同时具有高度的$\log_k n +1$,这是一个单位的最佳高度。更具体地说,我们表明,它是可能的,以确保$R$中的元素的深度不超过其深度在$T$加上最多$\log_k \log_k n +2$。同时,可以保证树$R$中的平均访问时间$P(R)$不大于树$T$中的平均访问时间$P(T)$加上$O(\log_k P(T))$。这表明,对于大多数应用程序,平衡树总是比不平衡树更好的选择,因为平衡树具有相似的平均访问时间和更好的最坏情况访问时间。
英文摘要:
In this paper we study the question of whether or not a static search tree should ever be unbalanced. We present several methods to restructure an unbalanced k-ary search tree $T$ into a new tree $R$ that preserves many of the properties of $T$ while having a height of $\log_k n +1$ which is one unit off of the optimal height. More specifically, we show that it is possible to ensure that the depth of the elements in $R$ is no more than their depth in $T$ plus at most $\log_k \log_k n +2$. At the same time it is possible to guarantee that the average access time $P(R)$ in tree $R$ is no more than the average access time $P(T)$ in tree $T$ plus $O(\log_k P(T))$. This suggests that for most applications, a balanced tree is always a better option than an unbalanced one since the balanced tree has similar average access time and much better worst case access time.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。