30# include <gsl/gsl_rng.h>
80 if (p == Node::NullPtr)
107 int t = std::time(
NULL);
112 cout <<
"testLuka " << n <<
" " << t <<
endl;
118 string s =
luka(tree_root);
119 cout <<
"luka(tree_root) = " << s <<
endl;
Exception handling system with formatted messages for Aleph-w.
#define ah_bad_alloc()
Throws std::bad_alloc unconditionally (no message stream)
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)
void destroyRec(Node *&root) noexcept
Free recursively all the memory occupied by the tree root
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 areSimilar(Node *t1, Node *t2) noexcept
Return true if both trees are similar.
void init_random(int seed)
size_t get_rand(const size_t &n)
Node * random_tree(const size_t &n)
Node * luka_to_tree(char *&cod)
Utility functions for binary tree operations.
Basic binary tree node definitions.