1 - Elabora a análise comparativa de desempenho, com um gráfico de linhas, para cada um dos três algoritmos de ordenação abaixo:
public void insertionSort(int a[]) {
for (int i=1;i< a.length;i++) {
for (int j=i;j>0;j--){
if (a[j]< a[j-1]) {
int temp = a[j];
a[j] = a[j-1];
a[j-1] = temp;
}
else {
break;
}
}
}
}
public void selectionSort(int a[]) {
for (int i=0;i< a.length-1;i++){
int menor = i;
for (int j=i+1;j< a.length;j++) {
if (a[j]< a[menor]){
menor = j;
}
}
int temp = a[menor];
a[menor] = a[i];
a[i] = temp;
}
}
public void bubbleSort(int[] a) {
for (int i=0;i< a.length;i++) {
for (int j=a.length-1;j>i;j--) {
if (a[j]< a[j-1]) {
int temp = a[j];
a[j]= a[j-1];
a[j-1] = temp;
}
}
}
}