47ofstream
file(
"avl-tree-aux.Tree", ios::out);
52 file << p->get_key() <<
" ";
61 try { n =
stoi(
argv[1]); }
catch (...) { n = 1000; }
66 cerr <<
"n must be positive" <<
endl;
70 unsigned int t = std::time(0);
73 try { t =
stoul(
argv[2]); }
catch (...) { t = std::time(0); }
78 cout <<
"writeAvl " << n <<
" " << t <<
endl;
84 cout <<
"Inserting " << n <<
" random values in treee ...\n";
86 for (i = 0; i < n; i++)
97 cout <<
endl <<
"verifying avl tree after insertions ... "
100 cout <<
" done" <<
endl;
Core header for the Aleph-w library.
bool is_avl(Node *p)
Validate that a tree satisfies AVL properties.
size_t size_t int32_t value
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.
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.
void destroyRec(Node *&root) noexcept
Free recursively 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.
AVL tree implementation (height-balanced BST).
Utility functions for binary tree operations.
static void print_key(Avl_Tree< int >::Node *p, int, int)