Closed iRumba closed 4 years ago
You're not dequeuing every node in the queue, so that test shouldn't necessarily be expected to pass...
As mentioned in the documentation, FastPriorityQueue
is not stable, meaning if multiple nodes have the same priority, the order they're dequeued is arbitrary. If you need a stable queue, use StablePriorityQueue
instead.
As mentioned in the documentation,
FastPriorityQueue
is not stable, meaning if multiple nodes have the same priority, the order they're dequeued is arbitrary. If you need a stable queue, useStablePriorityQueue
instead.
But it means We have not stable lib. See docs. :)
You can change this behavior. Fast method is change all usings HasHigherPriority to HasHigherOrEqualPriority in CascadeDown method. You can try.
No, that is not sufficient to make the data structure stable.
I give you one case
Second assertion will failed with any number of iterations
My first debug was on paper by code :)
You can see what happenes