42template <
template <
class>
class Container,
typename T>
45 cout <<
"Probando con contenedor tipo lista" << endl;
48 cout <<
"append de R values\n";
49 for (
int i = 0; i < n; ++i)
53 cout <<
"append de L values\n";
54 for (
int i = 0; i < n; ++i)
61 cout <<
"insert de R values\n";
62 for (
int i = 0; i < n; ++i)
66 cout <<
"insert de L values\n";
67 for (
int i = 0; i < n; ++i)
75 cout << it.get_curr() <<
" ";
79template <
template <
class,
class>
class Tree,
typename T>
82 cout <<
"Probando con contenedor tipo arbol" << endl;
85 cout <<
"insert de R values\n";
86 for (
int i = 0; i < n; ++i)
90 cout <<
"insert de L values (no debe insertar en arbol)\n";
91 for (
int i = 0; i < n; ++i)
98 cout <<
"insert_dup de R values\n";
99 for (
int i = 0; i < n; ++i)
103 cout <<
"insert_dup de L values\n";
104 for (
int i = 0; i < n; ++i)
108 l.
for_each([] (
const T & key) { cout << key <<
" "; });
115 Tree (*create)(int) = [] (
int n) ->
Tree
118 for (
int i = 0; i < n; ++i)
123 Tree tree = (*create)(n);
126int main(
int argc,
char * argv[])
131 try { n = std::stoi(argv[1]); }
132 catch (...) { n = 1000; }
135 test_map_tree<DynMapTree<int, int, Avl_Tree>>(n);
137 test_container <DynList, int> (n);
139 test_container <DynDlist, int> (n);
141 test_tree <Avl_Tree, int> (n);
T & append(const T &item)
T & insert(const T &item)
Dynamic set backed by balanced binary search trees with automatic memory management.
void for_each(Operation &operation) const
Traverse all the container and performs an operation on each element.
QuadTree - Hierarchical spatial index for 2D points.
Point * insert(Node *&r, const Point &p)
Recursive insert helper.
Singly linked list implementations with head-tail access.
Main namespace for Aleph-w library functions.
std::decay_t< typename HeadC::Item_Type > T
@ Tree
Basic arc (in spanning tree).
void test_container(int n)
void test_map_tree(int n)
Stack implementations backed by dynamic or fixed arrays.
Dynamic doubly linked list implementation.
Dynamic key-value map based on balanced binary search trees.
Dynamic set implementations based on balanced binary search trees.