It's probably better to add a `size()` method on `MaxHeap` instead of asking for length - 1 here.