public static final int[] quicksort(final int[] primaryIN,final int[] names){
  final int items=primaryIN.length;
  final int[] primary=new int[items];
  System.arraycopy(primaryIN,0,primary,0,items);
  int left=primary.length / 2;
  int right=primary.length - 1;
  while (left > 0) {
    left-=1;
    sift(primary,names,left,right);
  }
  while (right > 0) {
    final int tempA=primary[0];
    final int tempB=names[0];
    primary[0]=primary[right];
    names[0]=names[right];
    primary[right]=tempA;
    names[right]=tempB;
    right-=1;
    sift(primary,names,left,right);
  }
  return names;
}

public static final int [ ] quicksort ( final int [ ] primaryIN , final int [ ] names ) { final int items = primaryIN . length ; final int [ ] primary = new int [ items ] ; System . arraycopy ( primaryIN , 0 , primary , 0 , items ) ; int left = primary . length / 2 ; int right = primary . length - 1 ; while ( left > 0 ) { left -= 1 ; sift ( primary , names , left , right ) ; } while ( right > 0 ) { final int tempA = primary [ 0 ] ; final int tempB = names [ 0 ] ; primary [ 0 ] = primary [ right ] ; names [ 0 ] = names [ right ] ; primary [ right ] = tempA ; names [ right ] = tempB ; right -= 1 ; sift ( primary , names , left , right ) ; } return names ; }
sorts as a tree like structure in array representation
