Daew rapaziada do PJ…
bom, 1º - troquei o ArrayList para simplesmente um int[] e parece que melhorou a performance.
Como eu tava com dúvida como aumentar a memória do JVM eu botei a linha de código que me disseram “-Xm<size>”
e agora to com outro problema… uauhauhuah
dps disso soh o código que eu rodei quando botei esta linha de código (quicksort) parou de funcionar e me dah o seguinte erro…
An unexpected error has been detected by HotSpot Virtual Machine:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100185b0, pid=2588, tid=2908
Java VM: Java HotSpot™ Client VM (1.5.0_09-b03 mixed mode, sharing)
Problematic frame:
C [piAgent.dll+0x185b0]
An error report file with more information is saved as hs_err_pid2588.log
If you would like to submit a bug report, please visit:
http://java.sun.com/webapps/bugreport/crash.jsp
estranho é q os outros códigos continuam funcionando perfeitamente (Bubble, insertion, selection, merge)…
jah tentei até botar em outro código, em outro projeto, mas não adianta…
o código dele esta aqui…
[code]public class QuickSort {
public void quickSort(int[] vetor, int esq, int dir){
if (esq < dir){
int x = particao(esq, dir, vetor);
quickSort(vetor, esq, x - 1);
quickSort(vetor, x + 1, dir);
}
}
public int particao(int esq, int dir, int[] vetor){
int j = esq - 1;
int i = 0;
int aux = vetor[dir];
for (i = esq; i <= dir; i++){
if (vetor[i] <= aux){
int aux1 = vetor[i];
vetor[i] = vetor[++j];
vetor[j] = aux1;
}
}
return j;
}
}[/code]
vlw ajuda