Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.

Question

In algorithms, what is the Big-O time complexity of below algorithms (note: below code does nothing useful, it is just to test your Big-O knowledge):

```
a = 5
b = 6
c = 10
for i in range(n):
for j in range(n):
x = i * i
y = j * j
z = i * j
for k in range(n):
w = a * k +45
v = b * b
d = 33
```

In your answer, show how you get to the final answer (i.e. you should show the intermediate step before getting to final answer).Answer

3n^2 + 2n + 4 = **O(n^2)**

Question

In algorithms, what is the Big-O time complexity of below algorithms (note: below code does nothing useful, it is just to test your Big-O knowledge):

```
a = 5
b = 6
c = 10
for i in range(n):
for j in range(n):
x = i * i
y = j * j
z = i * j
for k in range(n):
w = a * k +45
v = b * b
d = 33
```

In your answer, show how you get to the final answer (i.e. you should show the intermediate step before getting to final answer).Answer

?

Question

In algorithms, what is the Big-O time complexity of below algorithms (note: below code does nothing useful, it is just to test your Big-O knowledge):

```
a = 5
b = 6
c = 10
for i in range(n):
for j in range(n):
x = i * i
y = j * j
z = i * j
for k in range(n):
w = a * k +45
v = b * b
d = 33
```

In your answer, show how you get to the final answer (i.e. you should show the intermediate step before getting to final answer).Answer

3n^2 + 2n + 4 = **O(n^2)**

If you want to change selection, open document below and click on "Move attachment"

status | not learned | measured difficulty | 37% [default] | last interval [days] | |||
---|---|---|---|---|---|---|---|

repetition number in this series | 0 | memorised on | scheduled repetition | ||||

scheduled repetition interval | last repetition or drill |

Do you want to join discussion? Click here to log in or create user.