[Noti-aed] tplr-2023-lev2tree_DemartinAlondra

Alondra Demartin alodemartin en gmail.com
Mar Nov 21 15:55:40 -03 2023


------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://venus.santafe-conicet.gov.ar/pipermail/noti-aed/attachments/20231121/4bed454c/attachment.html>
------------ próxima parte ------------
#define USECHRONO
#undef HAVE_MPI

#include "eval.hpp"
#include <cassert>
#include <climits>
#include <cstdlib>
#include <stack>
using namespace aed;
using namespace std;

//---:---<*>---:---<*>- COMIENZA CODIGO FUNCION --:---<*>---:---<*>---:---<*>
// COMPLETAR DNI y NOMBRE AQUI:
// Nombre: Alondra Demartin
int DNI=41979987;

//---:---<*>---:---<*>---:---<*>---:---<*>---:---<*>
tree<int>::iterator lev2tree(tree<int> &T, list<int> &level,list<int> &vals,
                             tree<int>::iterator it)
{
  if(level.empty() or vals.empty()) return it;
  
  it = T.insert(it,vals.front());
  vals.pop_front();
  int actual = level.front();
  level.pop_front();
  
  auto c =it.lchild();
  while(!level.empty() and actual+1 == level.front()){
    c = lev2tree(T,level,vals,c);
    c++;
    
    if(level.empty() or actual+1 != level.front())
      break;
  }
  
  return it;
}
void lev2tree(tree<int> &T, list<int> &level,list<int> &vals) {
  // COMPLETAR AQUI...
  lev2tree(T,level,vals,T.begin());
}

//---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*>
int main() {
  Eval ev;
  int vrbs=0;
  ev.eval<1>(lev2tree,vrbs);
  return 0;
}


Más información sobre la lista de distribución Noti-AED