Skip to content

Instantly share code, notes, and snippets.

@drnickallgood
Created January 11, 2017 18:10
Show Gist options
  • Save drnickallgood/f56e9869b3b9e0bc8b9d8745d4342973 to your computer and use it in GitHub Desktop.
Save drnickallgood/f56e9869b3b9e0bc8b9d8745d4342973 to your computer and use it in GitHub Desktop.
Big O Quiz
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