Imagine a game, Battlestrip, which involves one player laying down a set of horizontal line segments on his computer screen, and another player laying down a set of vertical segments on hers. Then the two computer screens are virtually overlaid on top of one another and the winner is the player with a single segment that intersects the most segments

Chapter 22, Application #8

Imagine a game, Battlestrip, which involves one player laying down a set of horizontal line segments on his computer screen, and another player laying down a set of vertical segments on hers. Then the two computer screens are virtually overlaid on top of one another and the winner is the player with a single segment that intersects the most segments of his or her opponent. Your job is to determine who is the winner. So, suppose you are given a set S of n horizontal and vertical line segments in the plane. Describe an algorithm running in O(n log n) time for finding the vertical segment, v, in S that intersects the maximum number of horizontal segments in S, as well as the horizontal segment, h, in S that intersects the maximum number of vertical segments in S.

This problem has been solved!


Do you need an answer to a question different from the above? Ask your question!
Related Book For answer-question

Algorithm Design And Applications

1st Edition

Authors: Michael T. Goodrich, Roberto Tamassia

ISBN: 9781118335918