46ofstream
output(
"splay-tree-aux.Tree", ios::out);
50 output << p->get_key() <<
" ";
58 try { n =
stoi(
argv[1]); }
catch (...) { n = 1000; }
63 cerr <<
"n must be positive" <<
endl;
67 unsigned int t = std::time(0);
70 try { t =
stoul(
argv[2]); }
catch (...) { t = std::time(0); }
75 cout <<
"writeSplay " << n <<
" " << t <<
endl;
81 cout <<
"Inserting " << n <<
" random values in tree ...\n";
83 for (i = 0; i < n; i++)
Core header for the Aleph-w library.
size_t size_t int32_t value
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.
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.
Utility functions for binary tree operations.
Top-down splay tree implementation (without rank support).
void print_key(Splay_Tree< int >::Node *p, int, int)