AVL 树是邪恶的吗?

发布于 2024-08-04 08:28:21 字数 1432 浏览 3 评论 0原文

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

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

发布评论

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

评论(6

乖乖哒 2024-08-11 08:28:21

从什么角度看恶呢?

一如既往:没有不好的工具,只有不好的工匠。

在我的记忆中,AVL 树的插入/删除速度较慢,但​​检索速度比红/黑树快。主要是因为平衡算法。

Evil from what point of view?

Like always: there are no bad tools, only bad craftsmen.

In my memory, AVL trees have slower insertion/removal but faster retrieval than Red/black. Mainly because of the balance algorithm.

屋檐 2024-08-11 08:28:21

不,AVL 树在任何方面都不是邪恶的。它们是完全有效的自平衡树结构。它们当然具有与红黑树不同的性能特征,并且通常这些差异导致人们选择红黑树而不是 AVL 树。但这并不意味着他们是邪恶的。

No, AVL trees are certainly not evil in any respect. They are a completely valid self balancing tree structure. They have different performance characteristics than Red-Black trees certainly and typically these differences lead to people choosing a red-black tree over an AVL tree. But this does not make them evil.

北渚 2024-08-11 08:28:21

我确信 AVL 树是邪恶的,就像 GOTO 是邪恶的或 BUBBLE SORT 是邪恶的一样。

算法并不邪恶,但算法也不会上下跳来告诉你它们何时合适。

I'm sure that AVL trees are evil in the same way that GOTO is evil or BUBBLE SORT is evil.

Algorithms aren't evil, but algorithms also don't jump up and down to tell you when they are appropriate either.

余生一个溪 2024-08-11 08:28:21

以下是有关红黑树和 AVL 树之间差异的大量信息:

http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=22948

和一篇比较不同结构的论文:

http://www.stanford.edu/~blp/papers/libavl.pdf

简而言之 - AVL 搜索速度更快,红黑插入速度更快。

Here's a lot of info about the differences between Red-Black and AVL-Trees:

http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=22948

and a paper comparing the different structures:

http://www.stanford.edu/~blp/papers/libavl.pdf

In short - AVL is faster to search, Red-Black faster to insert.

幼儿园老大 2024-08-11 08:28:21

Splay Trees 酷得多。 :)

Splay Trees are much cooler. :)

許願樹丅啲祈禱 2024-08-11 08:28:21

不,它们并不邪恶,只是编程起来有点棘手。

AVL树
http://www.eternallyconfuzzled.com/tuts/datastructs/jsw_tut_avl.aspx

红黑树链接也从那里开始。

No, they aren't evil, only a bit tricky to program.

AVL Trees
http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx

Red Black tree link from there too.

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