Last active
May 28, 2018 10:45
-
-
Save clara-shin/22aff67e07faa2dbbb169fdc41fe0d11 to your computer and use it in GitHub Desktop.
시간복잡도
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timeComplexity(arr, n) { | |
let sum = 0; // 1 | |
let i = 0; // 1 | |
let average = 0; // 1 | |
while(i < n) { // n + 1 | |
sum = sum + arr[i]; // n | |
i = i + 1; // n | |
} | |
average = sum / n; // 1 | |
return sum, average; // 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment