41 cout << p->get_key() <<
" ";
44static int r[] = { 776, 846, 736, 515, 528, 677, 404, 629, 879, 762 };
49 unsigned int t = std::time(0);
66 cerr <<
"Error: n must be a positive integer." <<
endl;
84 cout <<
"testSplayTree " << n <<
" " << t <<
endl;
90 cout <<
"Inserting " << n <<
" random values in treee ...\n";
94 for (i = 0; i < n; i++)
104 cout << value <<
" ";
114 for (i = 0; i < n; i++)
117 node = tree.
remove(value);
128 cout <<
"testSplayTree " << n <<
" " << t <<
endl;
Core header for the Aleph-w library.
Node *& getRoot() noexcept
Get the top-down splay tree's root.
Node * remove(const Key &key) noexcept
Remove a key from a top down splay tree.
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.
static void print(Splay_Tree< int >::Node *p, int, int)
Utility functions for binary tree operations.
Top-down splay tree implementation (without rank support).