Question: 7. (bonus 5 points). You are a software engineer for a large financial company. You need to propose a data structure the support the following

7. (bonus 5 points). You are a software engineer for a large financial company. You need to propose a data structure the support the following operations. (a) Transaction(amount, date) Your client earned an amount of amount at date date. For example, Transaction(300$, 4/15/2017). If the value in the amount is negative, it means that your client payed this amount. For reasons beyond my understanding, the date date is not necessarily today, but could be a date in the past of future. (something to do with Tax calculation). For example, I could report today that at 2008 the value of my house dropped. (b) Net Earning(date1, date2) What is the sum of all the transactions occurring between date till date. Note that the number of such transactions might be much larger than log n. Each operation should take O(log n) when n is the number of transactions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
