50 cout <<
"(" << p->
get_key() <<
"," << p->getCount() <<
")" ;
56 cout << p->get_key() <<
" ";
60int main(
int argc,
char *argv[])
77 cerr <<
"Error: n must be a positive integer." << endl;
81 unsigned int t = std::time(0);
97 cout << argv[0] <<
" " << n <<
" " << t << endl;
99 int value = (int) (100.0*n*rand()/(RAND_MAX+1.0));
102 for (
int i = 0; i < n - 1; i++)
106 value = (int) (100.0*n*rand()/(RAND_MAX+1.0));
118 cout << endl << endl;
126 cout << endl << endl;
Core header for the Aleph-w library.
WeightedDigraph::Node Node
size_t size_t int32_t value
Node for extended binary search tree.
static BinNodeXt *const NullPtr
__gmp_expr< T, __gmp_binary_expr< __gmp_expr< T, U >, unsigned long int, __gmp_root_function > > root(const __gmp_expr< T, U > &expr, unsigned long int l)
int preOrderRec(Node *root, void(*visitFct)(Node *, int, int))
Traverse recursively in preorder a binary tree.
bool check_rank_tree(Node *root) noexcept
Return true if root is a valid extended binary tree.
Node * insert_by_key_xt(Node *&r, Node *p, Compare &cmp) noexcept
Insert a node in an extended binary search tree.
void destroyRec(Node *&root) noexcept
Free all the memory occupied by the tree root
Node * searchInBinTree(Node *root, const typename Node::key_type &key, const Compare &cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >)
Search a key in a binary search tree using optimistic search.
Main namespace for Aleph-w library functions.
Node * balance_tree(Node *root)
Rebalance a binary search tree.
void print_node(Node *p, int, int)
void print_key(Node *p, int, int)
Tree balancing with extended nodes.
Lazy and scalable dynamic array implementation.