Question: Describe an efficient algorithm that, given a set $\{x1, \cdots, x_n\}$ of points on the real line, determines the smallest set of unit-length closed intervals that contains all of the given points.
Attempt: If we sort the points in any order we would like to start with, we will get $S=\{y_1, \cdots, y_n\}$. Next, we pick the smallest each time from $S$ and build a UNIT internal around it, so we have $S-\{smallest(S)\}$ left and the unit interval would be $[y_i, y_{i+1}]$. Keep following this approach would guarantee we cover the whole real line.
Complexity: apply any sorting algorithm to sort points in non-decreasing order. Then take smallest point and build unit interval, so we have $O(n\log{n})$.
Problem: I am not really sure what is the goal behind the question? The mail goal is basically to build unit intervals all across the line? If yes for what purpose (application) please?
Edit: I made a mistake as it should be $[y_i, y_{i}+1]$.