58 *
k++ = node->get_key();
97 try { n = std::stoi(
argv[1]); }
98 catch (...) { n = 10; }
103 cerr <<
"n must be greater than 0" <<
endl;
111 catch (...) {
prob = 0.5; }
114 unsigned int t =
static_cast<unsigned int>(
time(
nullptr));
117 try { t =
static_cast<unsigned int>(std::stoul(
argv[3])); }
118 catch (...) { t =
static_cast<unsigned int>(
time(
nullptr)); }
123 cout <<
argv[0] <<
" " << n <<
" " <<
prob <<
" " << t <<
" " <<
endl;
125 std::vector<int>
keys(
static_cast<size_t>(n));
131 for (
int i = 0; i < n; i++)
149 std::vector<double> p(
static_cast<size_t>(n));
150 for (
int i = 0; i < n; i++)
153 printf(
"%.5f ", p[
static_cast<size_t>(i)]);
size_t size_t int32_t value
Node for binary search tree.
Node *& getRoot() noexcept
Return the root of tree.
Node * insert(Node *p) noexcept
Insert a node in the tree.
Node * search(const Key &key) const noexcept
Search a key.
__gmp_expr< typename __gmp_resolve_expr< T, V >::value_type, __gmp_binary_expr< __gmp_expr< T, U >, __gmp_expr< V, W >, __gmp_min_function > > min(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
__gmp_expr< typename __gmp_resolve_expr< T, V >::value_type, __gmp_binary_expr< __gmp_expr< T, U >, __gmp_expr< V, W >, __gmp_pow_function > > pow(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
int preOrderRec(Node *root, void(*visitFct)(Node *, int, int))
Traverse recursively in preorder a binary tree.
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
Main namespace for Aleph-w library functions.
Optimal Binary Search Tree construction using dynamic programming.
Binary search tree with nodes without virtual destructors,.
void print(BinNode< int > *node, int, int)
void assign(BinTree< int >::Node *node, int, int)
double bin_coef(int n, int k)
Utility functions for binary tree operations.
Generic unbalanced binary search tree.