Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given a set of black and white intervals, select a smallest number of white inte

ID: 3849870 • Letter: G

Question

Given a set of black and white intervals, select a smallest number of white intervals that collectively overlap every black interval. State your greedy choice and prove its correctness.
Give the full algorithm and state the greedy choice and state its correctness Given a set of black and white intervals, select a smallest number of white intervals that collectively overlap every black interval. State your greedy choice and prove its correctness.
Give the full algorithm and state the greedy choice and state its correctness Given a set of black and white intervals, select a smallest number of white intervals that collectively overlap every black interval. State your greedy choice and prove its correctness.
Give the full algorithm and state the greedy choice and state its correctness

Explanation / Answer

solution--

1. Find the length of max black interval -->blk

2.Sort the white intervals in decreasing order of length.

3.Start selecting white intervals until the sum of lengths of white intervals becomes greater than or equal to blk.

Greedy choice here is selecting from the largest white interval so that the number of interval is minimum which is the aim of the question.

If you take any small interval instead of big one you will have to take more number of that which will defeat the purpose of the question , hence proved.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote