Computing complexity with Big-O notation
Task | Big-$O$ | |
---|---|---|
Task0.py | consistennt as independento of the size | |
Task1.py | Linear as it goes through both lists in the for loop, and not go through any lists in it. | |
Task2.py | Liniear as it goes through the calls, and not go through any lists in it. | |
Task3.py | It goes list twice, first in for loop, and second in converting list to set. But after that, it runs sorting, which contributes most to computation, |
|
Task4.py | It goes list twice, first in for loop, and second in converting list to set. But after that, it runs sorting, which contributes most to computation, |