Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/buscar.c Secret

Created Jan 13, 2021
Embed
What would you like to do?
struct nodoCadena *buscar(struct nodoCadena *nodo, char *cadena)
{
if (nodo == NULL)
{
return NULL;
}
if (strcmp(cadena, nodo->cadena) == 0)
{
return nodo;
}
else if (strcmp(cadena, nodo->cadena) > 0)
{
return buscar(nodo->derecha, cadena);
}
else
{
return buscar(nodo->izquierda, cadena);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment