Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it a "stable queue" or not? #20

Open
dko-slapdash opened this issue May 30, 2020 · 1 comment
Open

Is it a "stable queue" or not? #20

dko-slapdash opened this issue May 30, 2020 · 1 comment
Labels

Comments

@dko-slapdash
Copy link

dko-slapdash commented May 30, 2020

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...

@mourner
Copy link
Owner

mourner commented May 30, 2020

Probably not stable, but I should definitely check and update the docs — good point!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants