#define USECHRONO #undef HAVE_MPI #include "eval.hpp" #include #include #include #include #include using namespace aed; using namespace std; bool even(int x) { return x%2==0; } bool odd(int x) { return x%2; } bool ge7(int x) { return x>=7; } bool le3(int x) { return x<=3; } bool div4(int x) { return x%4==0; } bool isprime(int x) { return is_prime(abs(x)); } bool isnotprime(int x) { return !is_prime(abs(x)); } //---:---<*>---:---<*>- COMIENZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> // COMPLETAR DNI y NOMBRE AQUI: // Nombre: Meier Adrian int DNI=44367607; void fillbalance(btree &B,list &L, btree::iterator it){ int n = L.size(); if (L.empty()) return; if (n==1){ auto ita = L.begin(); it = B.insert(it,*ita); return; } if (n>1){ int k = n/2; auto itaux = L.begin(); list nleft; int c = 0; for(int i=0;i nright; while(itaux!=L.end()){ nright.push_back(*itaux); itaux++; // insertamos el resto en right } fillbalance(B,nleft, it.left()); fillbalance(B,nright, it.right()); } } void fillbalance(btree &B,list &L) { fillbalance(B,L,B.begin()); } //---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs=0; ev.eval<1>(fillbalance,vrbs); return 0; }