Question: Cloud Array is the new upcoming company that has an innovative business model. They offer services in secure array accesses. For this they charge their

Cloud Array is the new upcoming company that has an innovative business model. They offer services
in secure array accesses. For this they charge their customers per array access. They have different types
of cloud arrays and their pricing for cost per access is as follows:
Red[k] Blue[k] Green[k]
log k k log k k
Starc is running the following code on his machine:
Algorithm 1 Starcs Algorithm
1: function ProgramToRun(n: A natural number)
2: k 1
3: sum 0
4: for i 1 to n2 step 2 do
5: sum sum + Red[i]
6: if i == k then
7: sum sum + Blue[i]
8: for j 1 to k do
9: sum sum + Green[j]
10: end for
11: k 3\times k
12: end if
13: end for
14: return sum
15: end function
(a) Analyze the code and give the total asymptotic cost for accessing the Red array.
(b) Analyze the code and give the total asymptotic cost for accessing the Blue array.
(c) Analyze the code and give the total asymptotic cost for accessing the Green array.
(d) Starc feels he is spending too much money on array accesses. He switches to a new plan where
the costs are: Red[k]= k, Blue[k]= log k and Green[k]=1. Is this plan better in terms of total
asymptotic cost?

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!