We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7ecdc5 commit 363d805Copy full SHA for 363d805
src/main/java/com/thealgorithms/datastructures/heaps/MaxHeap.java
@@ -56,10 +56,6 @@ public MaxHeap(List<HeapElement> listElements) {
56
for (int i = maxHeap.size() / 2; i >= 0; i--) {
57
heapifyDown(i + 1); // +1 because heapifyDown expects 1-based index
58
}
59
-
60
- if (maxHeap.isEmpty()) {
61
- throw new IllegalStateException("No valid elements have been added; heap is empty.");
62
- }
63
64
65
/**
0 commit comments