55 file << p->get_key() <<
" ";
68 output << p->get_key() <<
" ";
82 unsigned int t = std::time(0);
87 try { n = std::stoi(
argv[1]); }
88 catch (
const std::exception & e)
90 cerr <<
"Warning: could not parse n from '" <<
argv[1]
91 <<
"': " << e.what() <<
". Using default n=1000" <<
endl;
97 try { t = std::stoi(
argv[2]); }
98 catch (
const std::exception & e)
100 cerr <<
"Warning: could not parse t from '" <<
argv[2]
101 <<
"': " << e.what() <<
". Using default t=" << t <<
endl;
107 cout <<
"n must be positive" <<
endl;
113 output.open(
"rb-example-aux.Tree", ios::out);
116 cerr <<
"Error: could not open rb-example-aux.Tree for writing" <<
endl;
120 file.open(
"rb-tree-aux.Tree", ios::out);
123 cerr <<
"Error: could not open rb-tree-aux.Tree for writing" <<
endl;
127 cout <<
"writeRb " << n <<
" " << t <<
endl;
134 for (i = 0; i < 30; i++)
159 for (i = 0; i < n; i++)
173 file <<
"START-SHADOW ";
Core header for the Aleph-w library.
size_t size_t int32_t value
Node * insert(Node *p) noexcept
Insert a node into the tree.
Node * search(const Key &key) const noexcept
Search for a key in the tree.
Node *& getRoot() noexcept
Get reference to root pointer.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
void destroyRec(Node *&root) noexcept
Free recursively all the memory occupied by the tree root
Main namespace for Aleph-w library functions.
#define RED
Red color constant (newly inserted nodes are red)
bool is_red_black(Node *node)
Test all Red-Black tree properties for a node.
Red-black tree with nodes without virtual destructor.
Utility functions for binary tree operations.
Red-Black tree implementation (bottom-up balancing).
static void print_color_ex(const Rb_Tree< int >::Node *p, int, int pos)
static void print_color(const Rb_Tree< int >::Node *p, int, int pos)
static void print_key(const Rb_Tree< int >::Node *p, int, int)
static void print_key_ex(const Rb_Tree< int >::Node *p, int, int)