code: public static void oddEvenSort( double arrayToBeSorted[], double[] arrayThatFollowsTheSort ) {
          for( int i = 0; i < arrayToBeSorted.length / 2; i++ ) {
              for( int j = 0; j + 1 < arrayToBeSorted.length; j += 2 )
                  if (arrayToBeSorted[j] > arrayToBeSorted[j + 1]) {
                      double tmpa = arrayToBeSorted[j];
                      arrayToBeSorted[j] = arrayToBeSorted[j + 1];
                      arrayToBeSorted[j + 1] = tmpa;
                      if (arrayThatFollowsTheSort != null) {
                          double tmpb = arrayThatFollowsTheSort[j];
                          arrayThatFollowsTheSort[j] = arrayThatFollowsTheSort[j + 1];
                          arrayThatFollowsTheSort[j + 1] = tmpb;
                      }
                  }
              for( int j = 1; j + 1 < arrayToBeSorted.length; j += 2 )
                  if (arrayToBeSorted[j] > arrayToBeSorted[j + 1]) {
                      double tmpa = arrayToBeSorted[j];
                      arrayToBeSorted[j] = arrayToBeSorted[j + 1];
                      arrayToBeSorted[j + 1] = tmpa;
                      if (arrayThatFollowsTheSort != null) {
                          double tmpb = arrayThatFollowsTheSort[j];
                          arrayThatFollowsTheSort[j] = arrayThatFollowsTheSort[j + 1];
                          arrayThatFollowsTheSort[j + 1] = tmpb;
                      }
                  }
          }
      }
docs: Sorts two arrays regarding to the sort of the first
  
  @param arrayToBeSorted the array on wich the sort is performed
  @param arrayThatFollowsTheSort the array that is sorted following the others array sort. Can
  be null