This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void elimina(String nombre, String marca) { | |
Nodo aux = cabeza; | |
// Evaluar si AUX esta vacida | |
if(aux != null){ | |
// Evaluar si el primero cumple condicion | |
if(nombre.equals(aux.getDato().getNombre()) && marca.equals(aux.getDato().getMarca())){ | |
cabeza = aux.getNext(); | |
ultimo.setNext(cabeza); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lista l = new Lista(); | |
l.inserta(new Pelicula("Blanca N", "Director1", 180, 1980)); | |
l.inserta(new Pelicula("Batman", "Director2", 190, 1995)); | |
l.inserta(new Pelicula("The Matrix", "Director1", 200, 2001)); | |
l.inserta(new Pelicula("Thor", "Director4", 150, 2001)); | |
l.inserta(new Pelicula("Avengers", "Director1", 180, 2010)); | |
l.inserta(new Pelicula("Ban", "Director1", 180, 2019)); | |
l.inserta(new Pelicula("CerCo", "Director2", 190, 1980)); | |
l.inserta(new Pelicula("Animalia", "Director1", 200, 1900)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Practica 2: public void elimina (int year) | |
public void elimina(int anio){ | |
Nodo aux = cabeza; | |
// Si ELIMINAR primer dato | |
if(anio == aux.getDato().getAnios()){ | |
cabeza = aux.getNext(); | |
aux = null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void extrae(String modelo) { | |
Nodo aux = frente; | |
// Recorrer la COLA | |
while(aux != null) { | |
// Evaluar si algun item de la COLA es igual a MODELO | |
if(modelo.equals(aux.getDato().getModelo())) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package fundamentosproyectofinal; | |
import java.io.*; | |
import java.util.*; |