Question: Helppppppppp please on 2g and 2h ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. (f) (4 points) Let's be clever about this... suppose we build an array A whose size is the

Helppppppppp please on 2g and 2h

.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Helppppppppp please on 2g and 2h ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. (f) (4 points) Let's be

(f) (4 points) Let's be clever about this... suppose we build an array A whose size is the same as B. but whose entries are cumulative total mass collected since the first week What is the running time to build such a structure, and how much space does it use? (We are not asking you to show us the pseudocode solution to this problem, but you should sketch it out in order to answer the question!) Time Space: (g) (4 points) Give an expression in terms of the new array A that can be used to answer queries like "what is the total mass of batteries collected between week 0 and week j Expression: Time h) (4 points) Give an expression in terms of the new array A that can be used to answer queries like "what is the total mass of batteries collected between week i and week j (inclusive)?" Also tell us the running time for answering the query. C 221 Winter 1, 2018 Expression: Time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!