Mi-séance 704, problèmes tests BH

This commit is contained in:
Favary Pierre 2021-04-07 14:14:28 +02:00
parent c3d9577472
commit aabddfa684

View file

@ -137,7 +137,13 @@ 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: int index=this.array.indexOf(x);
if (index<0)
throw new ElementNotFoundException(x);
this.array.set(index, this.array.get(this.array.size()-1));
this.currentSize--;
this.percolateDown(index);
} }
@Override @Override