×

# Covering: ZCO 2015

 0 How do I solve the Interval Covering Problem from ZCO 2015??? asked 03 Jan '15, 21:55 3★arpanb8 120●1●3●12 accept rate: 13%

 1 First sort the input sets according to their starting points. Now start considering 2 sets at a time, in the beginning the 1st and 2nd set. There are 3 cases which will come up. 1)the 2nd set is disjoint from the first one. eg. (1,3) & (5, 19) 2) the 2nd set is contained within the first one. eg. (1, 10) & (3, 7) 3) the 2nd set starts within the first set but ends after it. Think about how you should approach each of these conditions. HINT: At times you will increment the total points and at times you will change what sets to consider. This problem gets solved linearly. answered 04 Jan '15, 00:22 93●1●1●8 accept rate: 11% @arpanb8 You got the algorithm? If anybody needs help beyond this they can ask. (04 Jan '15, 23:26) (05 Jan '15, 19:53) arpanb83★ But @Organic-Shilling isn't the worst case complexity O(N^2)? How does it get solved linearly? Although, O(N^2) is enough for this problem... (05 Jan '15, 20:28) sandy9992★ yep...that is a q. that struck me 2...But n2 is enough for this prob... (05 Jan '15, 20:29) arpanb83★
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×989
×56
×37

question asked: 03 Jan '15, 21:55

question was seen: 793 times

last updated: 05 Jan '15, 20:29