m
This commit is contained in:
부모
d1dd889c1b
커밋
912b726b4d
2개의 변경된 파일과 11개의 추가작업 그리고 1개의 파일을 삭제
|
@ -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.
불러오는 중…
Reference in a new issue