Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 15, 2021 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/a5c0afc341636a425d087e7d094ba467 to your computer and use it in GitHub Desktop.
Save parzibyte/a5c0afc341636a425d087e7d094ba467 to your computer and use it in GitHub Desktop.
def __agregar_recursivo(self, nodo, dato):
if dato < nodo.dato:
if nodo.izquierda is None:
nodo.izquierda = Nodo(dato)
else:
self.__agregar_recursivo(nodo.izquierda, dato)
else:
if nodo.derecha is None:
nodo.derecha = Nodo(dato)
else:
self.__agregar_recursivo(nodo.derecha, dato)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment