Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kdgyun committed Aug 26, 2023
2 parents 60a5585 + 02de4ed commit 6322305
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion DataStructure/Java/_09_Heap/Heap.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ public E remove() {
throw new NoSuchElementException();
}
E result = (E) array[1];
E target = (E) array[size];
E target;
if(size == 1) {
target = null;
}
else {
target = (E) array[size];
}
array[size] = null;
size--;
siftDown(1, target);
Expand Down
8 changes: 7 additions & 1 deletion DataStructure/Java/_10_PriorityQueue/PriorityQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,13 @@ public E remove() {
}

E result = (E) array[1];
E target = (E) array[size];
E target;
if(size == 1) {
target = null;
}
else {
target = (E) array[size];
}

array[size] = null;
size--;
Expand Down

0 comments on commit 6322305

Please sign in to comment.