#define USECHRONO #undef HAVE_MPI #include "eval.hpp" #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: Varrone, Martina Victoria int DNI=44022756; void fillbalance(btree &B, btree::iterator n, list &L) { if(L.empty()) return; if(L.size() == 1){ auto t = L.begin(); n = B.insert(n,*t); } //nleft=n/2 (división entera) y nright=n-1-nleft. list Lleft; Lleft.clear(); list Lright; Lright.clear(); if(L.size()>1){ int nleft= L.size()/2; int k = nleft+1; int nright= L.size() -1 -nleft; int cont = 0; auto it = L.begin(); while(cont != nleft){ Lleft.push_back(*it); ++cont; ++it; } n = B.insert(n,*it); cont = 0; ++it; while(cont != nright){ Lright.push_back(*it); ++cont; ++it; } } fillbalance(B,n.left(),Lleft); fillbalance(B,n.right(),Lright); } void fillbalance(btree &B,list &L) { auto it = B.begin(); fillbalance(B,B.begin(),L); } //---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs=0; ev.eval<1>(fillbalance,vrbs); return 0; }