Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void remove(int index) {
- if (!(isEmpty())) {
- if (index > tamaño) {
- removeLast();
- } else {
- int contador = 0;
- Nodo nodoActual = lista;
- while (contador < index - 1) {
- nodoActual = nodoActual.getSig();
- contador++;
- }
- nodoActual.setSig(nodoActual.getSig().getSig());
- tamaño--;
- }
- }
- }
Add Comment
Please, Sign In to add comment