Elnidas

Untitled

Mar 25th, 2019
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public void remove(int index) {
  2. if (!(isEmpty())) {
  3. if (index > tamaño) {
  4. removeLast();
  5. } else {
  6. int contador = 0;
  7. Nodo nodoActual = lista;
  8. while (contador < index - 1) {
  9. nodoActual = nodoActual.getSig();
  10. contador++;
  11. }
  12. nodoActual.setSig(nodoActual.getSig().getSig());
  13. tamaño--;
  14. }
  15.  
  16. }
  17. }
Add Comment
Please, Sign In to add comment