+@ClassPreamble (
+ author = "Jérôme Benoit",
+ date = "05/03/2009"
+)
class Entiers extends Structure {
private int int_array[];
private int array_size;
return middle;
else if (value > int_array[middle])
return binarySearch((middle + 1), last, value);
- return binarySearch(first, (middle -1), value);
+ return binarySearch(first, (middle - 1), value);
}
public boolean supprimer(int value) {
}
public void compacter(int nElements) {
- // Remove the last nElements
- current_size -= nElements;
+ if (current_size - nElements > 0) {
+ // Remove the last nElements
+ current_size -= nElements;
+ } else {
+ current_size = 0;
+ }
}
-
}