This file contains hidden or 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
| package edu.unlam.swing; | |
| import java.awt.Font; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| import java.awt.event.WindowAdapter; | |
| import java.awt.event.WindowEvent; | |
| import javax.swing.JButton; | |
| import javax.swing.JFrame; |
This file contains hidden or 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
| es_un_pais(argentina). | |
| es_un_pais(brasil). | |
| es_un_pais(portugal). | |
| es_un_pais(china). | |
| limita_con(argentina, chile). | |
| limita_con(argentina, brasil). | |
| limita_con(usa, mexico). | |
| limita_con(usa, canada). |
This file contains hidden or 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
| package edu.unlam.impl; | |
| import edu.unlam.Ordenadora; | |
| public class QuickSort extends Ordenadora { | |
| @Override | |
| public void sort(Comparable[] elements) { | |
| sort(elements, 0, elements.length - 1); | |
| assert isSorted(elements); | |
| } |
This file contains hidden or 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
| package edu.unlam.impl; | |
| import edu.unlam.Ordenadora; | |
| public class Insersion extends Ordenadora { | |
| @Override | |
| public void sort(Comparable[] elements) { | |
| int n = elements.length; | |
| for (int i = 0; i < n; i++) { | |
| for (int j = i; j > 0 && elements[j].compareTo(elements[j - 1]) < 0; j--) { |
This file contains hidden or 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
| package edu.unlam.impl; | |
| import edu.unlam.Ordenadora; | |
| public class Seleccion extends Ordenadora { | |
| @Override | |
| public void sort(Comparable[] elements) { | |
| int n = elements.length; | |
| for (int i = 0; i < n; i++) { | |
| int min = i; |
This file contains hidden or 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
| package edu.unlam.impl; | |
| import edu.unlam.Ordenadora; | |
| public class Burbuja extends Ordenadora { | |
| @Override | |
| public void sort(Comparable[] elements) { | |
| int n = elements.length; | |
| for (int i = 0; i < (n - 1); i++) { | |
| for (int j = 0; j < n - i - 1; j++) { |
This file contains hidden or 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
| package test; | |
| import org.junit.Test; | |
| import edu.unlam.impl.Burbuja; | |
| import edu.unlam.impl.Insersion; | |
| import edu.unlam.impl.QuickSort; | |
| import edu.unlam.impl.Seleccion; | |
| public class OrdenadoraTest { |
This file contains hidden or 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
| package edu.unlam; | |
| import java.util.Comparator; | |
| /** | |
| * Clase ordenadora padre | |
| * | |
| * @param <T> - tipo de elementos a ser manipulados | |
| */ | |
| public abstract class Ordenadora<T> { |
This file contains hidden or 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
| private double[] getValues() { | |
| return new double[]{ 100, 115, 70, 115, 75, 80, 100, 90, 100, 95 }; | |
| } | |
| @Test | |
| public void calculateEstimatedParameters() { | |
| double[] values = getValues(); | |
| double sum = 0D; | |
| for (double value : values) { | |
| sum += value; |
This file contains hidden or 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
| matun1 | |
| 81470-ZGHV6-DSZLZ-MR6F3-2D6I8-M8RE7 | |
| matun2 | |
| 65154-YYGDY-PWASE-ZWJH1-GD8AI-3IIF4 | |
| matun3 | |
| 73384-79LBQ-G92L0-DOAG0-KYTWU-C6WP3 | |
| matun4 |