I am trying to read an algorithm for computing minimum distance between each pair of points from the book: Algorithm Design
It considers the points in a line. If the points are in a line why we need to sort them? We can start from the beginning and compute the distances from starting pint to all the points on the right.
Some body please guide me why we need sorting?