Compare commits
No commits in common. "c68a969b918330720af09c3daf1ce0abcffb33c1" and "cf4f368912ba48789650864dc140ff3166d29eee" have entirely different histories.
c68a969b91
...
cf4f368912
1 changed files with 0 additions and 10 deletions
|
|
@ -138,16 +138,6 @@ public class BinaryHeap<E extends Comparable<E>> implements PriorityQueue<E> {
|
||||||
@Override
|
@Override
|
||||||
public void remove(E x) throws ElementNotFoundException {
|
public void remove(E x) throws ElementNotFoundException {
|
||||||
// TODO:
|
// TODO:
|
||||||
if (isEmpty() || !array.contains(x)) {
|
|
||||||
throw new ElementNotFoundException(x);
|
|
||||||
}
|
|
||||||
int indice_suppression = array.indexOf(x);
|
|
||||||
arraySet(indice_suppression, array.get(this.currentSize - 1));
|
|
||||||
//array.remove(this.currentSize);
|
|
||||||
this.currentSize--;
|
|
||||||
if (indice_suppression < this.currentSize) {
|
|
||||||
percolateDown(indice_suppression);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue