BinaryHeaps drain() method only drains the heap in arbitrary order. The rotation test didn't catch it, as the arbitrary order is deterministic and happened to be correct. This PR changes the test so that the old drain method fails and replaces drain with a while + pop combination.
BinaryHeap
sdrain()
method only drains the heap in arbitrary order. The rotation test didn't catch it, as the arbitrary order is deterministic and happened to be correct. This PR changes the test so that the old drain method fails and replaces drain with a while + pop combination.