100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
AFN Y AFND $7.91
Add to cart

Class notes

AFN Y AFND

 3 views  0 purchase
  • Course
  • Institution

EJERCICIOS DE AFN Y AFND

Preview 3 out of 21  pages

  • August 27, 2021
  • 21
  • 2019/2020
  • Class notes
  • ---
  • All classes
avatar-seller
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;

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller messipro1239. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.91. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

51036 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 15 years now

Start selling
$7.91
  • (0)
Add to cart
Added