/* * programme TestSorts.java * auteur: felipe IFT1010 * objets: sensibilisation par la pratique a la complexite algorithmique */ import Sorts; import java.util.Date; public class TestSorts { private static final int BUBBLE = 1; private static final int INSERTION = 2; private static final int SELECTION = 3; private static final int MAX = 1000; private static final int MIN = 0; public static void main(String [] a) { int sortMethode = 1; // methode de tri par defaut int nbElements = 100; // nb d' elts par defaut long start,end; // pour le chrono // analyse de la ligne de commande if (a.length >= 1) { if (a[0].equalsIgnoreCase("insertion")) sortMethode = INSERTION; else if (a[0].equalsIgnoreCase("selection")) sortMethode = SELECTION; if (a.length >= 2) nbElements = Integer.parseInt(a[1]); // note: peut provoquer une erreur d' execution } int [] t = new int [nbElements]; // tests avec un tableau rempli aleatoirement for (int i=0; i