java.lang.Object
gov.nih.mipav.view.renderer.WildMagic.AAM.QuickSort

public class QuickSort extends Object
This is the local implementation of quicksort for delaunay triangulation.
Author:
Ruida Cheng
  • Field Details

  • Constructor Details

    • QuickSort

      public QuickSort(Comparator comparator)
  • Method Details

    • qsort

      public void qsort(Object[] v, int left, int right, Comparator comp)
    • qsort

      private void qsort(Object[] a, int lo0, int hi0)
      This is a generic version of C.A.R Hoare's Quick Sort algorithm. This will handle arrays that are already sorted, and arrays with duplicate keys.
      If you think of a one dimensional array as going from the lowest index on the left to the highest index on the right then the parameters to this function are lowest index or left and highest index or right. The first time you call this function it will be with the parameters 0, a.length - 1.
      Parameters:
      a - an Object array
      lo0 - left boundary of array partition
      hi0 - right boundary of array partition
    • swap

      private static void swap(Object[] a, int i, int j)
    • sort

      public void sort(Object[] a)
    • sort

      public void sort(Object[] a, int length)