Advertisement
DailySunnyOli

FUNCIONES ARBOLES 16/10/19

Oct 16th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. FUNCIONES DE ARBOLES MODIFICADAS AL 16/10/19
  2.  
  3. stnodoArbol* crearNodoA (int legajo, char nombre[20], char ocupacion[20])
  4. {
  5. stnodoArbol* aux= (stnodoArbol*) malloc (sizeof(stnodoArbol));
  6.  
  7. aux->der=NULL;
  8. aux->izq=NULL;
  9. aux->legajo= legajo;
  10. strcpy(aux->nombre, nombre);
  11. strcpy(aux->ocupacion, ocupacion);
  12.  
  13. return aux;
  14. }
  15.  
  16.  
  17. stnodoArbol* ArbolTransgenico (stnodoArbol* A)
  18. {
  19. stnodoArbol* aux;
  20.  
  21. aux=crearNodoA(5, "Phoebe Buffey", "actriz");
  22. A=agregarA(A, aux);
  23.  
  24. aux=crearNodoA(11, "Ursula Buffey", "actriz");
  25. A=agregarA(A, aux);
  26.  
  27. aux=crearNodoA(3, "Ross Geller", "actor");
  28. A=agregarA(A, aux);
  29.  
  30. aux=crearNodoA(9, "Ross Wewereonabreak", "actor");
  31. A=agregarA(A, aux);
  32.  
  33. aux=crearNodoA(1, "Monica Geller", "desocupado");
  34. A=agregarA(A, aux);
  35.  
  36. aux=crearNodoA(6, "Chandler Bing", "desocupado");
  37. A=agregarA(A, aux);
  38.  
  39. aux=crearNodoA(2, "Chanandler Bong", "desocupado");
  40. A=agregarA(A, aux);
  41.  
  42. aux=crearNodoA(4, "Rachel Green", "actriz");
  43. A=agregarA(A, aux);
  44.  
  45. aux=crearNodoA(7, "Rachel Anyway", "actriz");
  46. A=agregarA(A, aux);
  47.  
  48. aux=crearNodoA(8, "Joey Tribbiani", "actor");
  49. A=agregarA(A, aux);
  50.  
  51. aux=crearNodoA(0, "Janice OhmyGod", "actriz");
  52. A=agregarA(A, aux);
  53.  
  54. aux=crearNodoA(10, "Gunther Bartender", "actor");
  55. A=agregarA(A, aux);
  56.  
  57. return A;
  58.  
  59. }
  60.  
  61. void muestraUNO (stnodoArbol* nodo)
  62. {
  63. printf("\nLegajo: %d", nodo->legajo);
  64. printf("\nNombre: %s", nodo->nombre);
  65. printf("\nOcupacion: %s", nodo->ocupacion);
  66. printf("\n");
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement