Question: Introduction to Algorithm 3rd edition 1. (Exercise 16.2-5) Describe a greedy algorithm that, given a set (x,, x,, X,, x of points on the real
1. (Exercise 16.2-5) Describe a greedy algorithm that, given a set (x,, x,, X,, x of points on the real line (that is, floating point numbers), determines the smallest set of unit-length closed intervals that contains all of the given points. You may either describe the algorithm in English or provide pseudocode. For example, using the set (1.9, 7.0, 8.6, 8.8, 7.7), all of the following sets of closed intervals contain all of the given points but only the last set is a solution, because 3 is the minimum number of intervals required Then, prove that this problem has the greedy choice property. That is, show that there exists at least one minimum-size set covering all the points that includes whatever interval your algorithm would pick as the greedy choice (see the proof of Theorem 16.1 for reference)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
