betoesquivel

agregar al final de la lista

Sep 20th, 2013
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. template <class T>
  2. void Lista<T>::AgregarAlFinal(T dato)
  3. {
  4.     Nodo<T> *aux = new Nodo<T> ();  
  5.     Nodo<T> *temp = new Nodo<T> (dato);
  6.     aux = inicio;
  7.     while (aux->sig != NULL)
  8.     {
  9.         aux = aux->sig;
  10.     }
  11.     aux->sig = temp;
  12.  
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment