Re: contains
// ist Element vorhanden?
public boolean contains(X x) {
int i = 0;
boolean found = false;
while(!found && (i < this.filled)) {
found = this.comparator.same(this.elements[i], x);
++i;
}
return found;
}und dann im
IComparator<X>
public boolean same(X x1, X x2);und
in IntegerComparator
public boolean same(Integer x1, Integer x2) {
return x1 == x2;
}sieht irgendwie schöner aus ;)
naja, dafür benutze ich aber nicht das tolle Bisektionsverfahren...
Zuletzt bearbeitet von Seppo (21.07.2009 20:45:48)
Re: contains
@Seppo
lol!
Zuletzt bearbeitet von Julian (24.07.2009 01:38:17)