Java Array Min Value minFastSort(double[] x, int[] idx, int size)

Here you can find the source of minFastSort(double[] x, int[] idx, int size)

Description

min Fast Sort

License

Open Source License

Declaration

public static void minFastSort(double[] x, int[] idx, int size) 

Method Source Code

//package com.java2s;
//  it under the terms of the GNU Lesser General Public License as published by

public class Main {
    public static void minFastSort(double[] x, int[] idx, int size) {

        for (int i = 0; i < size; i++) {
            for (int j = i + 1; j < size; j++) {
                if (x[i] > x[j]) {
                    double temp = x[i];
                    int tempIdx = idx[i];
                    x[i] = x[j];//from ww w.  java 2  s  .c o  m
                    x[j] = temp;
                    idx[i] = idx[j];
                    idx[j] = tempIdx;
                } else if (x[i] == x[j]) {
                    if (idx[i] > idx[j]) {
                        double temp = x[i];
                        int tempIdx = idx[i];
                        x[i] = x[j];
                        x[j] = temp;
                        idx[i] = idx[j];
                        idx[j] = tempIdx;
                    }
                }
            }
        }
    }
}

Related

  1. minDouble(double a, double... others)
  2. minDouble(double... values)
  3. minDoubleArray(double[] data)
  4. minElement(int[] array)
  5. minFastSort(double x[], int idx[], int n, int m)
  6. minIdx(int[] in)
  7. minIgnoreIndex(double[] array, int indexToIgnore)
  8. minimum(char[] set)
  9. minimum(double[] list)