-
-
Save parzibyte/98bd5c155c0f2cdc6cc4e0d314931ee0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def eliminar(nodo, busqueda): | |
if nodo == None: | |
return | |
if nodo.dato == busqueda: | |
return nodo.siguiente | |
temporal = nodo | |
while temporal.siguiente != None: | |
if temporal.siguiente.dato == busqueda: | |
if temporal.siguiente.siguiente != None: | |
temporal.siguiente = temporal.siguiente.siguiente | |
else: | |
temporal.siguiente = None | |
return nodo | |
temporal = temporal.siguiente | |
return nodo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment