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.
明显的区别是,与堆的 O(n) 移除相比,红黑树可以支持 O(logn) 移除。
但是,看起来红黑树的所有操作都更快/等于堆的操作。所以我的问题是,为什么我们会在红黑树上使用堆?在我看来,红黑树可以做任何堆可以做的事情,但更快/相等。
谢谢。