示例#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;
 }
示例#2
0
        return new MWayTree_Iterator($this);
    }
    /**
     * Compares this M-way tree with the specified comparable object.
     * This method is not implemented.
     *
     * @param object IComparable $arg
     * The comparable object with which to compare this tree.
     */
    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("MWayTree main program.\n");
        $status = 0;
        $tree = new MWayTree(3);
        AbstractSearchTree::test($tree);
        return $status;
    }
}
if (realpath($argv[0]) == realpath(__FILE__)) {
    exit(MWayTree::main(array_slice($argv, 1)));
}
示例#3
0
 /**
  * Destructor.
  */
 public function __destruct()
 {
     $this->parent = NULL;
     parent::__destruct();
 }