/** * Main program. * * @param array $args Command-line arguments. * @return integer Zero on success; non-zero on failure. */ public static function main($args) { printf("Deap main program.\n"); $status = 0; $queue = new Deap(57); AbstractDoubleEndedPriorityQueue::test($queue); return $status; }
$pqueue->enqueue(box(1)); $pqueue->enqueue(box(4)); $pqueue->enqueue(box(1)); $pqueue->enqueue(box(5)); $pqueue->enqueue(box(9)); $pqueue->enqueue(box(2)); $pqueue->enqueue(box(6)); $pqueue->enqueue(box(5)); $pqueue->enqueue(box(4)); printf("%s\n", str($pqueue)); while (!$pqueue->isEmpty()) { $obj = $pqueue->dequeueMax(); printf("%s\n", str($obj)); } } /** * Main program. * * @param array $args Command-line arguments. * @return integer Zero on success; non-zero on failure. */ public static function main($args) { printf("AbstractDoubleEndedPriorityQueue main program.\n"); $status = 0; return $status; } } if (realpath($argv[0]) == realpath(__FILE__)) { exit(AbstractDoubleEndedPriorityQueue::main(array_slice($argv, 1))); }