Vous êtes sur la page 1sur 4

rbol binario de Bsqueda

Numero de nodos en un igual 2 potencia(h+1) 1, 2h de esos nodos son hojas y 2h 1


son nodos internos.

Valores menores en lado izquierdo y valores mayores de lado izquierdo


Archivos con Arboles bianrios
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "ABB.h"
#define long 1024

char dir[50];
int main()
{
ABB arbolVal=NULL;
ABB arbolconj=NULL;
FILE *archivo;
char line[long];
clrscr;
archivo=fopen("c:\\Primer_Proyecto\\VEHICULOS.txt", "r");
if(archivo==NULL)
{
cout<<"ningun dato en el archivo"<<endl;
exit(0);
}
while(fgets(line,long,archivo)!=NULL)
{
// clrscr();
cout<<"dato\n"<<line<<endl;
getch();

int i, dato;
char var[20]=" ";
char var1[20]=" ";
char var2[20]=" ";
char *aux;
i=0;

aux = strtok(line,",");
{
while(aux!=NULL)
{
if(i==0)
{
strcpy(var,aux);
dato=atoi(var);
insertar
}
if(i==1)
{
strcpy(var1,aux);
//dato=atoi(var1);
}
if(i==2) {
strcpy(var2,aux);
//dato=atoi(var2); }
i=i+1;
aux=strtok(NULL,","); }
cout<<dato<<endl;
cout<<var1<<endl;
cout<<var2<<endl;
//getch(); } }
fclose(archivo);
cout<<"fin del archivo"<<endl;
getch();}

Vous aimerez peut-être aussi