[Noti-aed] lev2tree
Agustín Saenz
agustinsaenzc en gmail.com
Mar Nov 21 16:08:31 -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/2987ed49/attachment-0001.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: Saenz Agustin
int DNI=42464943;
//---:---<*>---:---<*>---:---<*>---:---<*>---:---<*>
void lev2tree(tree<int>&T, tree<int>::iterator &it, list<int> &level, list<int> &vals, int l) {
if (level.empty() || vals.empty()) return;
it = T.insert(it, vals.front());
vals.pop_front();
level.pop_front();
tree<int>::iterator h = it.lchild();
while (!level.empty() && level.front() == l + 1) {
lev2tree(T,h, level, vals, l + 1);
h++;
}
}
void lev2tree(tree<int> &T, list<int> &level,list<int> &vals) {
if (level.empty() || vals.empty()) return;
T.clear();
auto it = T.begin();
lev2tree(T,it, level, vals, 0);
}
//---:---<*>---:---<*>- 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