Example #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 5.\n");
     $status = 0;
     GeneralTree::main($args);
     BinaryTree::main($args);
     NaryTree::main($args);
     BinarySearchTree::main($args);
     AVLTree::main($args);
     MWayTree::main($args);
     BTree::main($args);
     return $status;
 }
Example #2
0
            $this->attachSubtree($i, $btree->subtree[$j]);
        }
    }
    /**
     * Withdraws the specified object from this B-tree.
     * This method is not implemented.
     *
     * @param object BTree $obj The object to withdraw from this B-tree.
     */
    public function withdraw(IComparable $obj)
    {
        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("BTree main program.\n");
        $status = 0;
        $tree = new BTree(3);
        AbstractSearchTree::test($tree);
        return $status;
    }
}
if (realpath($argv[0]) == realpath(__FILE__)) {
    exit(BTree::main(array_slice($argv, 1)));
}