code: void runTasks(Task[] tasks, int maxTaskIndex) {
          for (int i = 0; i <= maxTaskIndex; i++) {
              runTasksInChain(tasks[i]);
              tasks[i] = null;
          }
      }
docs: Runs the pending page replacement policy operations.
  
  @param tasks        the ordered array of the pending operations
  @param maxTaskIndex the maximum index of the array