Hola soy principiante (quiero imprimir un arbol binario)
Publicado por Jonathan (1 intervención) el 26/11/2012 02:06:41
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<time.h>
struct arbol
{
struct arbol *left;
int info;
struct arbol *right;
};
typedef struct arbol nodetree;
typedef nodetree *arbolptr;
void insertar(arbolptr*L, int b);
void imprimir(arbolptr L);
void preorden(arbolptr L);
void entreorden(arbolptr L);
void posorden(arbolptr L);
void instrucciones();
main()
{
arbolptr L = NULL;
int inf, opcion,r;
instrucciones(),
printf("\n Seleccione una opcion: ");
scanf("%d",&opcion);
while(opcion!=6)
{
switch(opcion)
{
case 1:
...etc
}
MI PROBLEMA ES DE QUE NO SE COMO IMPRIMIR UN ARBOL BINARIO DE ESTA FORMA:
------------------------8
----------------4
-------------------------6
---------7
-----------------------10
----------------5
------------------------9
(SIN LOS GUINES)
ME GUATARIA QUE ME AYUDARAN, GRACIAS.
NOTA: UTILIZO "DEV-C++ 4.9.9.2
LOS DISTINTOS RECORRIDOS YA LOS TENGO HECHOS.
¿QUE REALIZO AQUI? :
1
2
3
4
5
6
7
void imprimir(arbolptr pactual)
{
if(pactual!=NULL)
{
}
}
Valora esta pregunta


0