Answered step by step
Verified Expert Solution
Question
1 Approved Answer
11. Consider the sweep-line algorithm for a set S = {s... Sn} of n segments (not necessarily horizontal or vertical). Assume that you stopped the
11. Consider the sweep-line algorithm for a set S = {s... Sn} of n segments (not necessarily horizontal or vertical). Assume that you stopped the algorithm once an intersecting pair is found. There are n(n-1)/2 pairs of segments. However the algorithm does not check every pair for intersection. Only pairs that are consecutive on the sweeping line are checked. If it costs one dollar to check if si crosses Sj, how many dollar (as as function of n) should you pay in the worst (most expensive) case ? Note that the same pair might be checked multiple times. Give a example of an input where there is a pair of segments si, s, and the algorithm checks more than 17 times if they intersect. (the very same pair). 11. Consider the sweep-line algorithm for a set S = {s... Sn} of n segments (not necessarily horizontal or vertical). Assume that you stopped the algorithm once an intersecting pair is found. There are n(n-1)/2 pairs of segments. However the algorithm does not check every pair for intersection. Only pairs that are consecutive on the sweeping line are checked. If it costs one dollar to check if si crosses Sj, how many dollar (as as function of n) should you pay in the worst (most expensive) case ? Note that the same pair might be checked multiple times. Give a example of an input where there is a pair of segments si, s, and the algorithm checks more than 17 times if they intersect. (the very same pair)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started