#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: Fernandez Solange int DNI=44288758; bool isbinary(tree&T,tree::iterator n){ int cont=0; n=n.lchild(); while(n!=T.end()){ cont++; n++; } if(cont>2) return false; } void buildBT(tree &A, btree &BT,tree::iterator n,btree::iterator bn) { if(n==A.end()){ return; } if(!isbinary(A,n)){ BT.clear(); return; } bn=BT.insert(bn,*n); while(isbinary(A,n)){ if (n.lchild()!=A.end()){ buildBT(A,BT,n.lchild(),bn.left()); } if (n++!=A.end()){ buildBT(A,BT,n++,bn.right()); } } } void buildBT(tree &A, btree &BT){ buildBT(A,BT,A.begin(),BT.begin()); } //---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs=0; ev.eval<1>(buildBT,vrbs); return 0; }