@@ -19,26 +19,40 @@ typedef struct {

typedef struct {
int nome;
struct Filhos *filho;
struct ListaV *filho;
struct Vertice *pai;
} Vertice;

typedef struct {
//struct Arestas *aresta;
struct Vertice *vertice;
struct Filhos *proximo;
} Filhos;
struct ListaV *proximo;
} ListaV;

/*typedef struct {
struct Vertice *filho;
struct Vertice *pai;
int peso;
} Arestas;*/

Arvore* criarArvore(Grafo* grafo, int verticeInit);
int adicionaVertice(int novoVertice, int verticePai, Arvore *tree);
Vertice* buscaVertice(int nome, Vertice *verticeAtual);
/* Funções de Criação */
Arvore* criarArvore();
Vertice* criarVerticeArvore(int nome);
void addPrimeiroVerticeArvore(Vertice* vertice, Arvore* arvore);
void addVerticeArvore(Vertice* novoVertice, Vertice* pai, Arvore* arvore);

/* Funções de busca */
Vertice* buscaVerticeArvore(int nome, Arvore* arvore);
Vertice* buscaVerticeFilhoArvore(int nome, Vertice* verticePai);

/* Funções de Leitura de Grafo */
Arvore* criarArvoreLargura( int verticeInicial, Grafo* grafo);

/* Funções de Impressao */
void putsArvore(Arvore* arvore);
void putsFilhos(Vertice* verticePai);

/* Função de Teste */
Arvore* testeArvore();

#endif
@@ -2,15 +2,20 @@
// Marlon Henry Schweigert
// Adriano Zanella Jr

//gcc -Wall CGrafos.c FGrafos.c CGrafos.h main.c -o grafoAdjv3
//gcc -Wall ArvoreLarga.c ArvoreLarga.h CGrafos.c CGrafos.h main.c -o arvoreLargura

#include <stdio.h>
#include "CGrafos.h"
#include "ArvoreLarga.h"


int main(void){
Grafo* grafo = leituraArquivo();
putsGrafo(grafo);
/*Grafo* grafo = leituraArquivo();
putsGrafo(grafo);*/
Arvore* tree = testeArvore();
putsArvore(tree);
buscaVerticeArvore(0, tree);
buscaVerticeArvore(3, tree);
buscaVerticeArvore(6, tree);
return 0;
}