X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/a57a70eab1f0b259f3b488a58e1812b262455b33..6eca7410b5a4c3c5225d852dd1d1ce9b74a7f4cd:/src/main.cpp?ds=sidebyside diff --git a/src/main.cpp b/src/main.cpp index c22dde9..c367a4c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,14 +5,19 @@ int main (int argc, char *argv[]) { - BTree *tree; - ClaveFija c(5); - - tree = new BTree ("test.idx", 1024); - - tree->AddKey (c); - - delete tree; + BTree tree ("test.idx", 64); + + if (argc != 2) { + printf ("Falta parametro cantidad de elementos a agregar\n"); + return 1; + } + + for (int i=0; i<=atoi(argv[1]); i++) { + ClaveFija c(i); + + std::cout << "Agregando " << i << std::endl; + tree.AddKey (c); + } return 0; }