Skip to content

Instantly share code, notes, and snippets.

@nathan-cruz77
Created May 4, 2015 17:09
Show Gist options
  • Save nathan-cruz77/ac6572151aed877c339d to your computer and use it in GitHub Desktop.
Save nathan-cruz77/ac6572151aed877c339d to your computer and use it in GitHub Desktop.
PArv pesquisa(PArv arv, PArv* pai, int x){
if(arv == NULL){
return NULL;
}
else if(arv->chave == x){
return arv;
}
else if(x < arv->chave){
*pai = arv;
return pesquisa(arv->esq, pai, x);
}
else{
*pai = arv;
return pesquisa(arv->dir, pai, x);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment