Skip to content

Commit 363d805

Browse files
committed
Fix
1 parent e7ecdc5 commit 363d805

File tree

1 file changed

+0
-4
lines changed
  • src/main/java/com/thealgorithms/datastructures/heaps

1 file changed

+0
-4
lines changed

src/main/java/com/thealgorithms/datastructures/heaps/MaxHeap.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ public MaxHeap(List<HeapElement> listElements) {
5656
for (int i = maxHeap.size() / 2; i >= 0; i--) {
5757
heapifyDown(i + 1); // +1 because heapifyDown expects 1-based index
5858
}
59-
60-
if (maxHeap.isEmpty()) {
61-
throw new IllegalStateException("No valid elements have been added; heap is empty.");
62-
}
6359
}
6460

6561
/**

0 commit comments

Comments
 (0)