end of day 4 week 1
This commit is contained in:
24
week 1/day 4/exo5.md
Normal file
24
week 1/day 4/exo5.md
Normal file
@@ -0,0 +1,24 @@
|
||||
**Task:**
|
||||
|
||||
* Explain what happens if the number of users doubles
|
||||
* Write the runtime formula using:
|
||||
|
||||
* `n` = number of users
|
||||
* `m` = average username length
|
||||
|
||||
**Expected reasoning:**
|
||||
|
||||
* Doubling the list doubles the execution time
|
||||
* Linear runtime: `T(n, m) = n × m`
|
||||
|
||||
**Answer**
|
||||
|
||||
if the number of user double in size
|
||||
|
||||
$$
|
||||
T(2n, m) = n /times 2 /times m
|
||||
$$
|
||||
|
||||
so the number of execution will multiply by 2
|
||||
|
||||
the big O notation will be O(n⋅m)
|
||||
Reference in New Issue
Block a user