Created
December 11, 2013 15:13
-
-
Save faloi/7912103 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
template<class TYPE> | |
NodoListaSE <TYPE> * NodoListaSE <TYPE>::Pop () | |
{ | |
NodoListaSE <TYPE> *ultimo = this->ObtenerUltimo(); | |
NodoListaSE <TYPE> *anteultimo = this->BuscarNodoAnteriorA(ultimo); | |
anteultimo.sgte = 0; | |
return ultimo; | |
} | |
template<class TYPE> | |
NodoListaSE <TYPE> *NodoListaSE <TYPE>::BuscarNodoAnteriorA(NodoListaSE <TYPE> *unNodo) | |
{ | |
NodoListaSE<TYPE> *nodoActual = this; | |
while (nodoActual->sgte) | |
{ | |
if (nodoActual->sgte == unNodo) | |
return nodoActual; | |
nodoActual = nodoActual->sgte; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment