Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. Arbre<Circuito::estacion> Circuito::preorden(int x, int pot) {
  2.   int dist, gas;
  3.   estacion est;
  4.   Arbre<estacion> a;
  5.   cin >> est.dist >> est.gas;
  6.   if (est.dist != -1 and est.gas != -1) {
  7.     est.ident = x;
  8.     Arbre<estacion> a1;
  9.     Arbre<estacion> a2;
  10.     a1 = preorden(2*x);
  11.     a2 = preorden(2*x + 1);
  12.     a.plantar(est, a1, a2);
  13.   }
  14.   return a;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement