98 unsigned int t = std::time(0);
115 cerr <<
"Error: n must be a positive integer." <<
endl;
133 cout <<
"writeAllTrees " << n <<
" " << t <<
endl;
141 cout <<
"Inserting " << n <<
" random values in treee ...\n";
143 for (i = 0; i < n; i++)
148 node = tree.
search(value);
167 cout <<
"Inserting " << n <<
" random values in treee ...\n";
169 for (i = 0; i < n; i++)
174 node = tree.
search(value);
193 cout <<
"Inserting " << n <<
" random values in treee ...\n";
195 for (i = 0; i < n; i++)
200 node = tree.
search(value);
219 cout <<
"Inserting " << n <<
" random values in treee ...\n";
221 for (i = 0; i < n; i++)
226 node = tree.
search(value);
245 cout <<
"Inserting " << n <<
" random values in treee ...\n";
247 for (i = 0; i < n; i++)
252 node = tree.
search(value);
271 cout <<
"Inserting " << n <<
" random values in treee ...\n";
273 for (i = 0; i < n; i++)
278 node = tree.
search(value);
Core header for the Aleph-w library.
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.
Node * search(const Key &key) const noexcept
Search a node containing key; if found, then a pointer to the node containing it is returned; otherwi...
constexpr Node *& getRoot() noexcept
Return a modifiable reference to tree's root.
Node * insert(Node *p) noexcept
Insert the node pointed by p in the tree.
Node * insert(Node *p) noexcept
Insert a node in the tree.
Node *& getRoot() noexcept
Return the tree's root.
Node * search(const Key &key) const noexcept
Search a key.
Node * insert(Node *p) noexcept
Insert a node into the tree.
Node * search(const Key &key) const noexcept
Search for a key in the tree.
Node *& getRoot() noexcept
Get reference to root pointer.
Node * search(const Key &key) const noexcept
Search a key in a treap.
Node *& getRoot() noexcept
Return the tree's root.
Node * insert(Node *root, Node *p) noexcept
Node *& getRoot() noexcept
Get the top-down splay tree's root.
Node * insert(Node *p) noexcept
Inserts a node in a top-down splay tree.
Node * search(const Key &key) noexcept
Searches a key in a top-down splay tree.
int preOrderRec(Node *root, void(*visitFct)(Node *, int, int))
Traverse recursively in preorder 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.
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.
AVL binary search tree with nodes without virtual destructor.
Binary search tree with nodes without virtual destructors,.
Randomized binary search tree.
Red-black tree with nodes without virtual destructor.
Treap (a special type of randomized binary search tree) using nodes without virtual destructor.
AVL tree implementation (height-balanced BST).
Utility functions for binary tree operations.
Generic unbalanced binary search tree.
Randomized binary search tree.
Red-Black tree implementation (bottom-up balancing).
Top-down splay tree implementation (without rank support).
Treap: randomized BST combining tree and heap properties.
void print_avl(Avl_Tree< int >::Node *p, int, int)
ofstream output_treap("treap.Tree", ios::out)
ofstream output_bin("bin.Tree", ios::out)
void print_rb(Rb_Tree< int >::Node *p, int, int)
void print_treap(Treap< int >::Node *p, int, int)
void print_splay(Splay_Tree< int >::Node *p, int, int)
void print_bin(BinTree< int >::Node *p, int, int)
ofstream output_rand("rand.Tree", ios::out)
ofstream output_splay("splay.Tree", ios::out)
void print_rand(Rand_Tree< int >::Node *p, int, int)
ofstream output_rb("rb.Tree", ios::out)
ofstream output_avl("avl.Tree", ios::out)