tinyqueue
tinyqueue copied to clipboard
Is it a "stable queue" or not?
Hi.
If I insert multiple items which are "equal" (i.e. for which the comparator returns 0), does pop() preserve the order in which the items were push()'ed? (Order preservation is called "stable property", i.e. there are "stable sorts", "stable queues" etc.)
Binary heap is typically not stable - https://cstheory.stackexchange.com/questions/593/is-there-a-stable-heap - so I assume tinyqueue is not stable as well?
It's not mentioned anywhere in the docs...
Probably not stable, but I should definitely check and update the docs — good point!