100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Lecture notes

AFN Y AFND

Rating
-
Sold
-
Pages
21
Uploaded on
27-08-2021
Written in
2019/2020

EJERCICIOS DE AFN Y AFND

Institution
Module










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Module

Document information

Uploaded on
August 27, 2021
Number of pages
21
Written in
2019/2020
Type
Lecture notes
Professor(s)
---
Contains
All classes

Subjects

Content preview

Ejercicio 1)

INICIO
RecursividadEstructura(Nodo)
SumaIzq = 0
SumaDer= 0
HijoIzquierdo = irHijoIzquierdo(Nodo)
SI <HijoIzquierdo != null > ENTONCES HACER
PostOrder( irHijoIzquierdo( Nodo ) )
SumaIzq = irHijoIzquierdo(Nodo).costoEstructura
FIN SI

SI <tieneHijoDerecho( Nodo )
PostOrder( irHijoDerecho( Nodo) )
SumaDer = irHijoDerecha(Nodo).costoEstructura
FIN SI
Nodo.costoEstructura =(Nodo.costoPropio * Nodo.cantidad)+ SumaIzq + SumaDer
FIN RecursividadEstructura()

Lista = ObtenerRaices()
Nodo = InicioL(Lista);

HACER MIENTRAS <Nodo != null>
RecursividadEstructura(Nodo)
Nodo = MoverENL()
FIN MIENTRAS
FIN


Ejercicio 2)

AUTO


public class Auto{
String patente ;
String fecha;
public Auto(String fechax,String Matricula){
patente = Matricula;
fecha = fechax;

}
public String toString() {
String tostring ="Auto Matricula: "+ patente +" Fecha y Hora: "+ fecha ;
return tostring;
}
public String getPatente() {
return patente;

, }
public void setPatente(String patente) {
this.patente = patente;
}
public String getFecha() {
return fecha;
}
public void setFecha(String fecha) {
this.fecha = fecha;
}

}

Linkedin Cola

import java.util.LinkedList;

public class ColaLKL {
private LinkedList<Auto> linkedin;
public ColaLKL() {
linkedin = new LinkedList<Auto>();
}
public boolean estaVacia() {
if(linkedin.size() != 0) {
return false;
}else {
return true;
}
}

public void vaciar(){
linkedin.clear();
}

public int largo() {
return linkedin.size();
}

public Auto verPrimero() {
return linkedin.peekFirst();
}

public Auto verUltimo() {
return linkedin.peekLast();
}

public void enfilar(Auto n) {
linkedin.offer(n);

, }
public void sacar(int n) {
linkedin.remove(n);
}


public LinkedList<Auto> getLinkedin() {
return linkedin;
}
public void setLinkedin(LinkedList<Auto> linkedin) {
this.linkedin = linkedin;
}


}




INTERFAZ GUI

import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JTextField;
import java.awt.Font;
import java.awt.Color;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
// Los import que uso son de GUI y de comparacion de fechas

//**IMPORTANTE** utilizo la fecha 16/11/2000 como fecha actual. Esto lo hago de esta
manera
//Ya que asi puedo mediante el GUI simular los dias y poder mostrar los registros de cada
dia
//Podria usar import java.util.Date pero en este caso los dias no podria simularlos ya que
//utilizaria el dia actual.

public class AutoLavado {

private JFrame frame;
private JTextField DiaLavado;
£6.74
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
messipro1239

Get to know the seller

Seller avatar
messipro1239 Universitat Autónoma de Barcelona
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
4 year
Number of followers
0
Documents
9
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions