a a Problem 7 (10%). Let S be a set of n integers. Given a value q, a half-range query reports all the numbers in S that
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
a a Problem 7 (10%). Let S be a set of n integers. Given a value q, a half-range query reports all the numbers in S that
a a Problem 7 (10%). Let S be a set of n integers. Given a value q, a half-range query reports all the numbers in S that are at most q. Describe a data structure on S that can answer any half-range query in 0(1+k) time, where k is the number of integers reported. Your structure must consume O(n) space. For example, consider S = {20, 35, 10, 60, 75,5, 80,51}. A query with q = 15 reports 5, 10.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!