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 d4e31f1 commit 78794e6Copy full SHA for 78794e6
src/main/java/com/thealgorithms/datastructures/heaps/MinHeap.java
@@ -143,7 +143,9 @@ private void heapifyDown(int elementIndex) {
143
* @param elementIndex 1-based index of the element to move up
144
*/
145
private void toggleUp(int elementIndex) {
146
- if (elementIndex <= 1) return;
+ if (elementIndex <= 1) {
147
+ return;
148
+ }
149
150
double key = minHeap.get(elementIndex - 1).getKey();
151
int parentIndex = (int) Math.floor(elementIndex / 2.0);
0 commit comments