m
This commit is contained in:
parent
d1dd889c1b
commit
912b726b4d
2 changed files with 11 additions and 1 deletions
|
@ -136,8 +136,18 @@ public class BinaryHeap<E extends Comparable<E>> implements PriorityQueue<E> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// on est là
|
||||||
public void remove(E x) throws ElementNotFoundException {
|
public void remove(E x) throws ElementNotFoundException {
|
||||||
// TODO:
|
ArrayList<E> temp = new ArrayList<E>();
|
||||||
|
for (E e : array){
|
||||||
|
if (e != x){
|
||||||
|
temp.add(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i=array.indexOf(x);i<array.size()-1;i++){
|
||||||
|
array.set(i, temp.get(i-1));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue