In this problem, we will consider how to use/modify range trees to answer a number of queries. In each case, the input is an n-element point set P in IRd . In each case, explain what points are stored in the range tree, what the various levels of the range tree are, and how queries are answered. Finally, justify your algorithm’s correctness and derive its storage and running time as a function of n. Note that you don’t have to re-copy entire pieces of pseudocode or proof - if it is the same as the one covered in class or the lecture notes or book, just say so! If it’s very close, you are welcome to discuss (in detail) only the differences with the version covered in class or the book.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

In this problem, we will consider how to use/modify range trees to answer a number of queries. In each case, the input is an n-element point set P in IRd . In each case, explain what points are stored in the range tree, what the various levels of the range tree are, and how queries are answered. Finally, justify your algorithm’s correctness and derive its storage and running time as a function of n.

Note that you don’t have to re-copy entire pieces of pseudocode or proof - if it is the same
as the one covered in class or the lecture notes or book, just say so! If it’s very close, you
are welcome to discuss (in detail) only the differences with the version covered in class or the
book.

(a) A skewed rectangle is defined by two points q
− = (x
−, y−) and q
+ = (x
+, y+). The the
range shape is a parallelogram that has two vertical sides and two sides with a slope of
+1. The lower left corner is q
− and the upper right corner is q
+. The answer to the
query is the number of points of P that lie within the parallelogram. (In Figure 2(a),
the answer to the given query is 3.)

(b) In a vertical segment-sliding query (VSS), you are given a vertical line segment with
x-coordinate x0 and endpoints at y-coordinates y0 and y1, where y0 < y1. The answer
to the query is the point that is first hit if the segment is translated to the right. More
formally, among the points of P whose y-coordinates lie within the interval [y0, y1], the
answer is the point with the smallest x coordinate greater than or equal to x0. If there
are no points that satisfy these conditions, the query returns the special value null. (For
example, in Figure 2(b), the query returns point a.)
Hint: In all cases, it is possible to answer queries in O(log2 n) time. (Cascading, which
we mentioned but didn’t discuss in detail, should not be needed.) 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY