Skip to content

Instantly share code, notes, and snippets.

@lesimoes
Created December 29, 2018 13:49
Show Gist options
  • Save lesimoes/4c1aea899e486f2917cf2b563719c140 to your computer and use it in GitHub Desktop.
Save lesimoes/4c1aea899e486f2917cf2b563719c140 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define TAM 10
struct arvore {
char info;
struct no *esq, *dir;
}parvore;
void inserir(struct arvore *plist, char valor){
if(plist == NULL){
plist = (parvore) malloc(sizeof(struct arvore));
plist->info = valor;
plist->esq = NULL;
plist->dir = NULL;
}else{
if(valor < plist->info)
inserir(&plist->esq, valor);
else
inserir(&plist->dir, valor);
}
}
int main(){
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment