Skip to content

Instantly share code, notes, and snippets.

@clara-shin
Created May 28, 2018 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clara-shin/549af662902631d8fc541bf496f490c1 to your computer and use it in GitHub Desktop.
Save clara-shin/549af662902631d8fc541bf496f490c1 to your computer and use it in GitHub Desktop.
시간복잡도 구하기
// first
i = 1; // 1
while (i <= n) { // n + 1
x = x + 1; // 1
i = i + 1; // 1
}
// second
int i, j;
for(i=1; i <= n; i++) // n
for(j=i; j <= n; j++) // n
if(j < i)
C[i,j] = A[i] * B[j];
// 이중반복이므로 n * n = n^2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment