Closed treeowl closed 1 year ago
I'm not sure what you mean. Isn't the shape of a binomial queue fully determined by its size? How does extractBin
fail to shrink the spine?
Yes, it's supposed to be. But our types don't inherently prevent Skip Nil
, which we must avoid to maintain that uniqueness, and extractMin
doesn't do what it needs to in that regard.
extractBin
doesn't distinguish between a forest that doesn't contain the minimum and a forest that is actually empty. It therefore fails to shrink the spine when it drops below a power of two. So if a queue was ever large, it will not regain the full performance of a small queue as it is drawn down. I think the easy thing is to add a constructor toMExtract
to indicate that the forest is nil.