Let's assume that I have a sorted list of start_time and duration pair which is sorted based on start_time. I need to find all entries that cover a specific time. For example:
index start_time duration
--------------------------------
1 2 7
2 4 1
3 5 3
4 7 4
find(6) = {1,3}
I can do this easily in O(n) by simply traversing through list. But I wonder if there is any algorithm or data structure to improve this time. Any idea?