Question: Analyse the algorithm below and provide its time complexity function and its big-O complexity. Assume that assignment addition, subtraction, multiplication and division each take one

Analyse the algorithm below and provide its time complexity function and its big-O complexity. Assume that assignment addition, subtraction, multiplication and division each take one time unit. Show your working out.

a := 5

b := 6

c := 10

For i = 1 to n-2, Do,

For j = 1 to n-3, Do,

x := i ^ 3

y := j - 1

z := i / j

End For

End For

For k = 1 to n, Do,

w := a * k + 45

v := b * b

End For

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!