Código
import java.awt.*; import javax.swing.*; public LinesRectsOvals() { super( "GRAFICO" ); setSize( 500,500 ); setVisible( true ); } public void stop(int tiempo) { } public static void Quicksort(int A[], int b, int t) { int pivote; if(b < t){ pivote=colocar(A, b, t); Quicksort(A, b, pivote-1); Quicksort(A, pivote+1, t); } } public static int colocar(int A[], int b, int t) { int i; int pivote, valor_pivote; int temp; pivote = b; valor_pivote = A[pivote]; for (i=b+1; i<=t; i++){ if (A[i] > valor_pivote){ pivote++; temp=A[i]; A[i]=A[pivote]; A[pivote]=temp; } } temp=A[b]; A[b]=A[pivote]; A[pivote]=temp; return (int) pivote; } { int A[]=new int[470]; int p=0,q=469; super.paint( g ); g.drawLine(30,0,30,470); g.drawLine(30,470,500,470); for(int y=0;y<469;y++) {stop(50); A[y]=valor; g.drawLine(30+y,470,30+y,valor); } g.fillRect(0,0,500,500); Quicksort(A,p,q); for(int x=0;x<469;x++) {stop(50); g.drawLine(30+x,470,30+x,A[x]); } } { LinesRectsOvals application = new LinesRectsOvals(); } }