• No results found

Final Exam Geometric Algorithms, March 14, 2007, 9–12

N/A
N/A
Protected

Academic year: 2021

Share "Final Exam Geometric Algorithms, March 14, 2007, 9–12"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Final Exam Geometric Algorithms, March 14, 2007, 9–12

Read every question carefully, make sure you understand it, and be sure to answer the question. Read the question again after answering it, as a check. Make the easier questions first, and then the harder ones. You may not use any algorithmic result from the book, unless it is explicitly stated that this is allowed in the question. Answer questions in sufficient but not too much detail. You may not use the book during the exam.

Be sure to put your name on every piece of paper you hand in. Also write down your

“collegekaartnummer”. Good luck!

1. (1.5 points)

(a) Let P be a set of points that all lie on the upper convex hull. What can you say about the lines dual to these points?

(b) Let S be a set of disjoint line segments that lie on the same (non-vertical) line ℓ.

Let ℓ be a line not parallel to ℓ and not vertical, and let ℓ lie above all line segments of S. What is the dual situation for S, ℓ, and ℓ?

2. (1.5 points)

Here is a paranoid algorithm to compute the maximum of a set A of n real numbers:

Algorithm ParanoidMaximum(A) 1. if card(A) = 1 // the cardinality of A 2. then return the unique element x ∈ A 3. else Pick a random element x from A.

4. x →ParanoidMaximum(A \ {x}) 5. ifx ≤ x

6. then return x

7. elseNow we suspect that x is the maximum, but to be absolutely sure, we compare x with all card(A) − 1 other elements of A.

8. returnx

Analyse the worst-case and the expected running time of this algorithm.

3. (1 point)

The search structure that is made during the randomized incremental construction algorithm for planar point location is a directed acyclic graph. It is not a tree, because there may be undirected cycles. In what situation(s) in the construction algorithm are undirected cycles made?

1

Dit tentamen is in elektronische vorm beschikbaar gemaakt door de TBC van A–Eskwadraat.

A–Eskwadraat kan niet aansprakelijk worden gesteld voor de gevolgen van eventuele fouten in dit tentamen.

1

(2)

4. (1 point)

Suppose the Delaunay triangulation T of a set P of n points in the plane is given.

We want to compute for each point of P which other point of P is closest to it (so the output consists of n pairs of points, where the first points of all pairs are different).

Sketch an efficient algorithm that, given T , solves this problem, and analyze its running time.

5. (2 points)

Let T be a set of n disjoint triangles and let C be a set of n disjoint unit circles in the plane. Give a plane sweep algorithm that reports in O(n log n) time the number of triangles in T that (entirely) contain at least one circle from C. Define the status, describe the status structure, define the events that your algorithm will have, and how they are treated.

Analyze the time taken for handling each event, and use this to justify that the overall running time of the algorithm is O(n log n).

6. (2 points)

(a) Describe a 1D interval tree storing n intervals. What is the storage requirement?

Describe a query with a point for all intervals containing that point. What is the query time?

(b) Describe a 1D segment tree storing n intervals. What is the storage requirement?

Describe a query with a point for all intervals containing that point. What is the query time?

7. (1 point)

A rectilinear polygon is a simple polygon of which all edges are horizontal or vertical.

Give an example to show that ⌊n/4⌋ cameras may be necessary to guard a rectilinear polygon with n vertices.

2

2

Referenties

GERELATEERDE DOCUMENTEN

We consider the time interval between a user’s best answers, and we measure it as the number of days between the moment a user joined the forum and when the posted his N-th best

The size and complexity of global commons prevent actors from achieving successful collective action in single, world- spanning, governance systems.. In this chapter, we

• You may use results proved in the lecture or in the exercises, unless this makes the question trivial.. When doing so, clearly state the results that

Suppose that the structure was built and now we have a search graph that can report the face containing any query point efficiently.. (a.) Explain why the expected size of the

More precisely, the collection of all lines that intersect a line segment dualizes to the collection of all points inside the double wedge that is the dual of that line segment3.

If it does not lie below the current solution, then the new solution is the intersection of the line just added with some line from L p , namely the one that has the

(2 points) Some person Xyz wants to develop a data structure that can store a set P of n points in the plane, so that for any query point, the closest two points of P can be

(b) Describe a data structure requiring expected linear storage that allows us to determine the first segment in S intersected by a ray running vertically upward from a query point (