(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).
(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).
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images