|
Pessoal,
Estou com a seguinte d�vida. Esta classe � uma
Thread e no run, eu quero colocar uma fun��o, por�m ocorre um erro "illegal
start of expression". Como eu posso sair disto..........Depois que a vari�vel
troca � incrementada eu tenho que chamar o paint da Applet..
M�rio.
class Quick extends Thread
{ Ordenacao_trab applet; int vet[] = {10,9,8,7,6,5, 4, 3, 2, 1}; int i = vet[0]; int s = vet[vet.length - 1]; int e=i, d=s; int item = vet[ ((e+d)/2) ]; int troca = 0; int compara = 0; public Quick(Ordenacao_trab c)
{ applet = c; // a applet e inicializada aqui no construtor } public void run()
{ void quickSort(int i, int s) { while ( e <= d ) { while ( vet[e] < item ) e++; while ( vet[d] > item ) d--; if ( e <= d ) { int aux; // Vari�vel auxiliar para as trocas aux = vet[e]; vet[e] = vet[d]; vet[d] = aux; d--; e++; troca++; } } if ( d-i > 0 ) quickSort(i,d); if ( s-e > 0 ) quickSort(e,s); } } } |
