#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: Axel Emanuel Echevarria int DNI=42271710; /// funcion auxiliar para ver si es AOO (o no) void es_AOO_recursiv(tree &A,tree::iterator it_A, bool &es_aoo) { if( it_A == A.end() ) return; auto it_aux = it_A; int c = 0; while(it_aux != A.end()){ it_aux++; c++; } if(c>=3) es_aoo = false; auto h = it_A.lchild(); while(h != A.end()) { es_AOO_recursiv(A,h,es_aoo); h++; } } /// func_ aux void buildBT(tree &A,tree::iterator it_A, btree &BT,btree::iterator it_B) { if(it_A == A.end()) return; it_B = BT.insert(it_B,*it_A); if(it_A.lchild() != A.end() ) { buildBT(A,it_A.lchild(),BT,it_B.left()); buildBT(A,++it_A.lchild(),BT,it_B.right()); } } ///wrapper void buildBT(tree &A, btree &BT) { bool es_aoo = true; es_AOO_recursiv(A,A.begin(),es_aoo); if(es_aoo == true) { buildBT(A,A.begin(),BT,BT.begin()); } } //---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs=0; ev.eval<1>(buildBT,vrbs); return 0; }