Question: You are given a target interval [0,M] (in the X axis), as well as n segments of line S = {s1, s2,..., sn} with coordinates
You are given a target interval [0,M] (in the X axis), as well as n segments of line S = {s1, s2,..., sn} with coordinates si = [li, ri], sorted by their li coordinates.
Design a greedy algorithm to choose the min number of segments that cover the interval [0,M] and analyze the running time of your algorithm.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
