Пример #1
0
 /**
  * Main program.
  *
  * @param array $args Command-line arguments.
  * @return integer Zero on succes; non-zero on failure.
  */
 public static function main($args)
 {
     printf("Demonstration program number 6.\n");
     $status = 0;
     BinaryHeap::main($args);
     LeftistHeap::main($args);
     BinomialQueue::main($args);
     Deap::main($args);
     return $status;
 }
Пример #2
0
        return new BinaryHeap_Iterator($this);
    }
    /**
     * Compares this heap with the specified comparable object.
     * This method is not implemented.
     * @param object IComparable $arg
     * The comparable object with which to compare this heap.
     * @exception MethodNotImplemented Always.
     */
    protected function compareTo(IComparable $arg)
    {
        throw new MethodNotImplementedException();
    }
    /**
     * Main program.
     *
     * @param array $args Command-line arguments.
     * @return integer Zero on success; non-zero on failure.
     */
    public static function main($args)
    {
        printf("BinaryHeap main program.\n");
        $status = 0;
        $queue = new BinaryHeap(57);
        AbstractPriorityQueue::test($queue);
        return $status;
    }
}
if (realpath($argv[0]) == realpath(__FILE__)) {
    exit(BinaryHeap::main(array_slice($argv, 1)));
}