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

Already on GitHub? Sign in to your account

fix pqueue2:is_empty/1 #8

Merged
merged 1 commit into from Aug 28, 2012

Conversation

Projects
None yet
2 participants
Contributor

yamt commented Aug 27, 2012

if is_empty being O(1) is important, an alternative fix would be to
have out/2 to normalize empty queues.

@yamt yamt fix pqueue2:is_empty/1
if is_empty being O(1) is important, an alternative fix would be to
have out/2 to normalize empty queues.
844dc8a
Owner

okeuday commented Aug 28, 2012

Thanks, this makes is_empty/1 more correct for now. I don't believe I will pursue normalizing (shrinking the tree) empty queues because of the other efficiency problems I found with this structure. I know a heap solution is more typical for a priority queue, but I convinced myself it was a bad approach in Erlang. Thank you for the change!

@okeuday okeuday added a commit that referenced this pull request Aug 28, 2012

@okeuday okeuday Merge pull request #8 from yamt/pqueue2-fix
fix pqueue2:is_empty/1
9c467db

@okeuday okeuday merged commit 9c467db into okeuday:master Aug 28, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment