12 pointsA project manager would like to store a set of n project intervals. Each interval consists of a start and
end time (over a year-long period), a project title and a maximum budget (in dollars). The manager
would like a data structure that organizes the project intervals in such a way that she can carry out the
following operations in the specified runtime:
1. Insert and delete new projects Time: O(log n).
2. Given a time t, output the total number of projects that start before time t Time: O(logn).
3. Given a time t, output a list of the budgets of all projects that start after time t Time: O(logn+k),
where k the the number of projects that start after time t.
4. Given a time t, print the title of the project that is the last to finish out of all those that start
after time t. Time: O(n)
5. Given a start time t, output the titles of the next 10 projects that start after time t, in increasing
order budget. O(logn).
Your job:
Describe a data structure that is suitable for this problem, and the details of the attributes used in your
ndoes. You must justify the runtime to build the structure in time O(n logn) and explain how to carry
out the above operations in the given runtime. You may use algorithms from class where necessary.