This commit is contained in:
Bensouda Idriss 2023-03-28 18:15:31 +02:00
부모 d1dd889c1b
커밋 912b726b4d
2개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제

파일 보기

@ -136,8 +136,18 @@ public class BinaryHeap<E extends Comparable<E>> implements PriorityQueue<E> {
} }
@Override @Override
// on est
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