Ejemplo n.º 1
0
  public static void sort(Comparable[] a) {
    int N = a.length;
    Comparable[] aux = new Comparable[N];
    d = new Draw();
    flag = new int[N];

    totalFigNum =
        (int) Math.pow(2, Math.ceil(Math.log(N / gate) / Math.log(2))); // total figure number
    d.setYscale(0, 1.2 * totalFigNum);
    d.setXscale(0, N);
    show(a, times++, totalFigNum, "input");

    sort(a, aux, 0, N - 1);
  }