67 cout <<
" " << node->get_key();
77 catch (...) { n = 2; }
82 cerr <<
"Error: n must be a positive integer." <<
endl;
86 unsigned int t = std::time(0);
90 try { t =
static_cast<unsigned int>(
stoul(
argv[2])); }
91 catch (...) { t = std::time(0); }
96 cout <<
argv[0] <<
" " << n <<
" " << t <<
endl;
WeightedDigraph::Node Node
Node for binary search tree.
__gmp_expr< T, __gmp_binary_expr< __gmp_expr< T, U >, unsigned long int, __gmp_root_function > > root(const __gmp_expr< T, U > &expr, unsigned long int l)
int preOrderRec(Node *root, void(*visitFct)(Node *, int, int))
Traverse recursively in preorder a binary tree.
TNode * bin_to_forest(BNode *broot)
Converts a binary tree to its equivalent forest.
void destroy_forest(Node *root)
Destroys (frees memory) the forest whose first tree is root.
int inOrderRec(Node *root, void(*visitFct)(Node *, int, int))
Traverse recursively inorder a binary tree.
void destroyRec(Node *&root) noexcept
Free recursively all the memory occupied by the tree root
void forest_preorder_traversal(Node *root, void(*visitFct)(Node *, int, int))
Preorder traversal of a forest.
BNode * forest_to_bin(TNode *root)
Converts a forest to its equivalent binary tree.
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
bool areEquivalents(Node *t1, Node *t2, Equal &op) noexcept
Return true if trees are equivalents.
static void printNode(Node *node, int, int)
BinNode< int > * random_tree(int l, int r)
Utility functions for binary tree operations.
General tree (n-ary tree) node.