Question: answering quad tree querys and a search/insert algorithm that takes O(1) time average but O(logn) worst case. please explain. 5. (a) We are given a
answering quad tree querys and a search/insert algorithm that takes O(1) time average but O(logn) worst case. please explain.

5. (a) We are given a quad tree containing a set S of n points. We are also given a query point q. Explain how could you use the tree to find if q is in S? What is the time to answer this query? Note that the tree is already constructed, so do not spend time constructing other data structure. (b) Repeat question 5a, but now the data structure is a 2D range trees (c) Repeat question 5a, now the data structure is a 2D k-d tree. 6. Suggest a data structure for a set of integers such that insertions or searching for a point takes O(1) time on average, but O(log n) in the worst case. Here n is the nuber of keys stored in the data structure
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
