Skip to content

Instantly share code, notes, and snippets.

@faloi
Created December 11, 2013 15:13
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 faloi/7912103 to your computer and use it in GitHub Desktop.
Save faloi/7912103 to your computer and use it in GitHub Desktop.
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