Priority queue
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
An ordered queue
Priority queues help consumers consume the higher priority messages first followed by the lower priority messages.
Is heap data structure
search is still O(N). On the other hand, It is best for finding min/max in a set O(1).
add and remove is LogN, due to rebalancing
Tree set is red black tree
https://stackoverflow.com/questions/16540082/what-are-the-differences-between-heap-and-red-black-tree
https://www.freecodecamp.org/news/priority-queue-implementation-in-java/
https://www.educba.com/priority-queue-vs-heap/
https://cs.stackexchange.com/questions/105899/why-use-heap-over-red-black-tree