Example #1
0
 private void remove(
     Sorted<Integer> sorted, int startIndex, int nrIterations, int[] itemsToRemove) {
   for (int i = startIndex; i < startIndex + nrIterations; i++) {
     sleep();
     sorted.remove(itemsToRemove[i]);
   }
 }
Example #2
0
 private void add(Sorted<Integer> sorted, int startIndex, int nrIterations, int[] itemsToAdd) {
   for (int i = startIndex; i < startIndex + nrIterations; i++) {
     sleep();
     sorted.add(itemsToAdd[i]);
   }
 }