(50 MARKS) (Greedy Algorithms) Describe an efficient algorithm that, given a set {x1, x2,...,xn} of points on the real line, determines the smallest set of unit- length closed intervals that contains all of the given points. Give a correct greedy algorithm for this problem (15 marks), prove that it finds the optimal solution (20 marks), and give an efficient implementation (15 marks).

icon
Related questions
Question
(50 MARKS) (Greedy Algorithms) Describe an efficient algorithm that, given a
set {x1, x2,...,xn} of points on the real line, determines the smallest set of unit-
length closed intervals that contains all of the given points. Give a correct greedy
algorithm for this problem (15 marks), prove that it finds the optimal solution (20
marks), and give an efficient implementation (15 marks).
Transcribed Image Text:(50 MARKS) (Greedy Algorithms) Describe an efficient algorithm that, given a set {x1, x2,...,xn} of points on the real line, determines the smallest set of unit- length closed intervals that contains all of the given points. Give a correct greedy algorithm for this problem (15 marks), prove that it finds the optimal solution (20 marks), and give an efficient implementation (15 marks).
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer