X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/8a5515f7e7d38bb41a711b1d8a1ac6cee750ef18..f0a17b3d23f3f277957d3e97ac1c7c1869d6d4cc:/src/main.cpp?ds=sidebyside diff --git a/src/main.cpp b/src/main.cpp index 58a00ec..069b3ac 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,7 +34,8 @@ 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); km.AddValue (*it); it++;