Class TwoArraysSort


  • public final class TwoArraysSort
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void sortDoubleArrayByLongValues​(long[] longArray, double[] doubleArray, int length)
      Sort two arrays simultaneously based on values of the first (long) array.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • sortDoubleArrayByLongValues

        public static void sortDoubleArrayByLongValues​(long[] longArray,
                                                       double[] doubleArray,
                                                       int length)
        Sort two arrays simultaneously based on values of the first (long) array. E.g. {[4, 1, 8], [0.5, 1.9, 0.9]} -> {[1, 4, 8], [1,9, 0.5, 0.9]}
        Parameters:
        longArray - Array of long values (e.g. neighbours ids)
        doubleArray - Array of double values (e.g. neighbours weighs)
        length - Number of values to sort