Open wahyudierwin opened 2 years ago
In this main code, https://github.com/stevenhalim/cpbook-code/blob/f8f34ba6f096d30360f48575405ae99e764f41f7/ch7/points_lines.java#L174-L180
i changed into
point[] P = new point[7]; P[0] = new point(3.6, 4.5); P[1] = new point(0, 2); P[2] = new point(1.75, 6.75); P[3] = new point(2.4, 3); P[4] = new point(5.6, 5.8); P[5] = new point(0.5, 1.5); P[6] = new point(4.75, 2.1);
And the result after Arrays.sort(P) is
Arrays.sort(P)
(0.00, 2.00) (0.50, 1.50) (1.75, 6.75) (2.40, 3.00) (3.60, 4.50) (5.60, 5.80) (4.75, 2.10)
Shouldn't the (4.75, 2.10) appear before (5.60, 5.80)?
In this main code, https://github.com/stevenhalim/cpbook-code/blob/f8f34ba6f096d30360f48575405ae99e764f41f7/ch7/points_lines.java#L174-L180
i changed into
And the result after
Arrays.sort(P)
isShouldn't the (4.75, 2.10) appear before (5.60, 5.80)?