100int main(
int argc,
char *argv[])
103 unsigned int t = std::time(0);
120 cerr <<
"Error: n must be a positive integer." << endl;
138 cout <<
"writeAllTrees " << n <<
" " << t << endl;
146 cout <<
"Inserting " << n <<
" random values in treee ...\n";
148 for (i = 0; i < n; i++)
152 value = 1+(int) (n*1.0*rand()/(RAND_MAX+1.0));
172 cout <<
"Inserting " << n <<
" random values in treee ...\n";
174 for (i = 0; i < n; i++)
178 value = 1+(int) (n*1.0*rand()/(RAND_MAX+1.0));
198 cout <<
"Inserting " << n <<
" random values in treee ...\n";
200 for (i = 0; i < n; i++)
204 value = 1+(int) (n*1.0*rand()/(RAND_MAX+1.0));
224 cout <<
"Inserting " << n <<
" random values in treee ...\n";
226 for (i = 0; i < n; i++)
230 value = 1+(int) (n*1.0*rand()/(RAND_MAX+1.0));
250 cout <<
"Inserting " << n <<
" random values in treee ...\n";
252 for (i = 0; i < n; i++)
256 value = 1+(int) (n*1.0*rand()/(RAND_MAX+1.0));
276 cout <<
"Inserting " << n <<
" random values in treee ...\n";
278 for (i = 0; i < n; i++)
282 value = 1+(int) (n*1.0*rand()/(RAND_MAX+1.0));
Core header for the Aleph-w library.
size_t size_t int32_t value
Node * insert(Node *p) noexcept(nothrow_compare_copy_v< Compare, Key >)
Insert a node in the tree.
Node *& getRoot() noexcept
Return the root of tree.
Node * search(const Key &key) const noexcept(nothrow_compare_copy_v< Compare, Key >)
Search a key.
Node * insert(Node *p) noexcept(nothrow_compare_v< Compare, Key >)
Insert the node pointed by p in the tree.
constexpr Node *& getRoot() noexcept
Return a modifiable reference to tree's root.
Node * search(const Key &key) const noexcept(nothrow_compare_v< Compare, Key >)
Search a node containing key.
Node *& getRoot() noexcept
Return the tree's root.
Node * search(const Key &key) const noexcept(nothrow_compare_v< Compare, Key >)
Search a key.
Node * insert(Node *p) noexcept(nothrow_compare_copy_v< Compare, Key >)
Insert a node in the tree.
Node * search(const Key &key) const noexcept(nothrow_compare_v< Compare, Key >)
Search for a key in the tree.
Node * insert(Node *p) noexcept(nothrow_compare_v< Compare, Key >)
Insert a node into the tree.
Node *& getRoot() noexcept
Get reference to root pointer.
Node *& getRoot() noexcept
Return the tree's root.
Node * search(const Key &key) const noexcept(nothrow_compare_v< Compare, Key >)
Search a key in a treap.
Node * insert(Node *root, Node *p) noexcept(nothrow_compare_v< Compare, Key >)
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 all the memory occupied by the tree root
Main namespace for Aleph-w library functions.
AVL binary search tree with nodes without a 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)