[Noti-aed] tpl3-2023-createab-Demartin_Alondra

Alondra Demartin alodemartin en gmail.com
Jue Nov 9 20:40:09 -03 2023


------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://venus.santafe-conicet.gov.ar/pipermail/noti-aed/attachments/20231109/62567d2d/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;

//---:---<*>---:---<*>---:---<*>---:---<*>---:---<*>
void createab(btree<int> &B, btree<int>::iterator n,
              list<int> &abpos,list<int> &vals, int p) {
  // COMPLETAR AQUI...
  if(abpos.empty() or vals.empty()) return;

  auto pos = abpos.begin();
  auto val = vals.begin();
  
  if(find(abpos.begin(),abpos.end(),p)==abpos.end()) return;
  
  if(*pos == p){
    n = B.insert(n,*val);
    abpos.erase(pos);
    vals.erase(val);
  }
  else{
    ++pos; 
    ++val;
    
  }
  createab(B,n.left(),abpos,vals,2*p+1);
  createab(B,n.right(),abpos,vals,2*p+2);

}

//---:---<*>---:---<*>---:---<*>---:---<*>---:---<*>
void createab(btree<int> &B, list<int> &abpos,list<int> &vals) {
  createab(B,B.begin(),abpos,vals,0);
}

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


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