Created
January 11, 2017 18:10
-
-
Save drnickallgood/f56e9869b3b9e0bc8b9d8745d4342973 to your computer and use it in GitHub Desktop.
Big O Quiz
This file contains 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
What is the big-O performance estimate of the following function? | |
int f (n) { | |
int sum = 0; | |
for (i = 0; i < n; i++) | |
sum += i; | |
return sum; | |
} // end f | |
my answer - O(n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment