Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在学习 AVL 树,并且我知道如何进行所有旋转,但我需要知道的一件事是如何制作它,以便在每次插入或旋转后更新节点的平衡因子。
谢谢!
看看现有的 AVL 树实现。这是我最初为 Hypersonic SQL 编写的,它仍然用作我的H2 数据库的一部分:
TreeNode TreeIndex TreeCursor