public static void main(String[] args) { Comparator<Float> ic = new Comparator<Float>() { public int compare(Float o1, Float o2) { return (int) (o1 - o2); } }; Float[] original = new Float[]{2f, 1f, 5f, 3f, 4f, 6f, 8f, 9f, 11f, 10f, 12f, 13f, 14f, 15f, 7f, 19f, 20f, 18f, 16f, 17f, 21f, 23f, 22f, 24f, 25f, 27f, 26f, 29f, 28f, 30f, 31f}; Float[] sorted = new Float[original.length]; while (true) { test(original, sorted, ic); } }
public static void main(String[] args) { Comparator<Float> ic = new Comparator<Float>() { public int compare(Float o1, Float o2) { return (int) (o1 - o2); } }; Float[] original = new Float[]{2f, 1f, 5f, 3f, 4f, 6f, 8f, 9f, 11f, 10f, 12f, 13f, 14f, 15f, 7f, 19f, 20f, 18f, 16f, 17f, 21f, 23f, 22f, 24f, 25f, 27f, 26f, 29f, 28f, 30f, 31f}; Float[] sorted = new Float[original.length]; while (true) { test(original, sorted, ic); } }
public static void main(String[] args) { Comparator<Float> ic = new Comparator<Float>() { public int compare(Float o1, Float o2) { return (int) (o1 - o2); } }; Float[] original = new Float[]{2f, 1f, 5f, 3f, 4f, 6f, 8f, 9f, 11f, 10f, 12f, 13f, 14f, 15f, 7f, 19f, 20f, 18f, 16f, 17f, 21f, 23f, 22f, 24f, 25f, 27f, 26f, 29f, 28f, 30f, 31f}; Float[] sorted = new Float[original.length]; while (true) { test(original, sorted, ic); } }