X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/8a5515f7e7d38bb41a711b1d8a1ac6cee750ef18..98e331147474997778f92d14b794a94f1dc3bedb:/src/main.cpp?ds=sidebyside diff --git a/src/main.cpp b/src/main.cpp index 58a00ec..13d7c34 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,8 +34,14 @@ int main (int argc, char *argv[]) double l = Random::Double (0.0f, 1.0f); std::cout << l << " >= " << paltas << std::endl; - if (l >= paltas) { + if (!km.Size() // si no tenemos claves agregadas, mejor que hagamos un alta + || l >= paltas) { tree.AddKey (c); + try { + tree.AddKey (c); + } catch (Exception *e) { + std::cout << e->Message () << std::endl; + } km.AddValue (*it); it++; } else {