#define USECHRONO #undef HAVE_MPI #include "eval.hpp" #include #include #include #include using namespace aed; using namespace std; //---:---<*>---:---<*>- COMIENZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> // COMPLETAR DNI y NOMBRE AQUI: // Nombre: Giordano Matias int DNI=45343290; //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> void createab(btree &B, btree::iterator n, list &abpos,list &vals) { // COMPLETAR AQUI... int pos = 0; ///si la lista de posiciones es vacia hago un return if(abpos.empty()) {return;} ///sino es vacia guardo la pos y el val en dos variables e inserto en el iterador el valor else { pos = abpos.front(); abpos.pop_front(); int val = vals.front(); vals.pop_front(); n = B.insert(n,val); } ///recursion por hijo izquierdo if (!abpos.empty() and abpos.front() == (2*pos+1)) { createab(B, n.left(),abpos,vals); } ///recursion por hijo derecho if (!abpos.empty() and abpos.front() == (2*pos+2)) { createab(B,n.right(),abpos,vals); } } //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> void createab(btree &B, list &abpos,list &vals) { createab(B,B.begin(),abpos,vals); } //---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs=0; ev.eval<1>(createab,vrbs); // ev.evalr<1>(createab,12345,vrbs); return 0; }