apgregar al final de listas encadenadas


/ Published in: C++
Save to your folder(s)

Para agregar al final de listas encadenadas.


Copy this code and paste it in your HTML
  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. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.