关于二叉搜索树的问题?

发布于 2024-09-16 11:28:00 字数 156 浏览 3 评论 0原文

今天,在课堂上,我的教授们说有一个平衡二叉搜索树,我以前从未听说过。我想知道是否有不旋转的平衡二叉搜索树? 根据我的理解,平衡二叉搜索树就是AVL树。除此之外,我认为不可能建立“平衡二叉搜索树”。 但是,如果存在这样的数据结构,我如何从一系列随机数构建“平衡二叉搜索树”?

谢谢,

Today, in class my professors said there's a balance binary search tree which I never heard of it before. I would like to know is there a Balance Binary Search tree without rotation?
From my understanding, Balance Binary Search Tree is AVL tree. Besides that I don't think it's possible to build a 'Balance Binary Search Tree'.
But if in case there's a data structure like that, how could I build a 'Balance Binary Search Tree' from a series of random numbers?

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

弥枳 2024-09-23 11:28:00

使用随机数填充平衡二叉搜索树背后的想法就像您将向树添加节点,其键是随机数。当您要实现平衡二叉搜索树时,请用 100 或 1000 个具有随机数的节点填充它。高度应尽可能小——这是平衡二叉搜索树的关键特征。

除了AVL树(如红黑树)之外,还存在平衡二叉搜索树。使用平衡二叉搜索树搜索 google。

The idea behind populating balanced binary search tree using random numbers is like you will be adding nodes to the tree, whose keys are random numbers. When you'll implement a balanced binary search tree, populate it with 100s or 1000s of nodes with random number. The height should be as small as possible - which is the key feature of balanced binary search tree.

There exists balanced binary search trees other than AVL trees (like Red-Black Tree). Search google with balanced binary search tree.

无风消散 2024-09-23 11:28:00

维基百科在任何与树相关的文章的底部都有一个很好的树列表,例如 http://en .wikipedia.org/wiki/Self-balancing_binary_search_tree

Wikipedia has a nice list of trees at the bottom of any tree related article such as http://en.wikipedia.org/wiki/Self-balancing_binary_search_tree

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文