Пример #1
0
    //}>b
    //{
    /**
     * Sorts the array to which the array field refers.
     * Calls the recursive quicksort method to do the actual sort.
     * Since the recursive quicksort method stops short of finishing the sort,
     * this method uses a StraightInsertionSorter to finish the job.
     */
    protected function doSort()
    {
        $this->sortSlice(0, $this->n - 1);
        $sorter = new StraightInsertionSorter();
        $sorter->sort($this->array);
    }
    //}>c
    /**
     * Main program.
     *
     * @param array $args Command-line arguments.
     * @return integer Zero on success; non-zero on failure.
     */
    public static function main($args)
    {
        printf("AbstractQuickSorter main program.\n");
        $status = 0;
        return $status;
    }
}
if (realpath($argv[0]) == realpath(__FILE__)) {
    exit(AbstractQuickSorter::main(array_slice($argv, 1)));
}
 /**
  * Destructor.
  */
 public function __destruct()
 {
     parent::__destruct();
 }