#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: Firmani Valentina int DNI=42329567; 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, tree::iterator n, btree &BT, 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,n.lchild(),BT,bn.left()); } if(n.right() != A.end()){ buildBT(A,n++,BT,bn.right()); } } } void buildBT(tree &A, btree &BT) { buildBT(A,A.begin(),BT,BT.begin()); } //---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs=0; ev.eval<1>(buildBT,vrbs); return 0; }