13.04.2013 Views

Análise de complexidade - UFMG

Análise de complexidade - UFMG

Análise de complexidade - UFMG

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

-<br />

-<br />

-<br />

n<br />

n*n<br />

n*n<br />

n*n*n<br />

n*n*n<br />

-<br />

-<br />

-<br />

-<br />

// A, B e C sao vetores globais<br />

void e1(int n)‏ {<br />

int i, j, k;<br />

for(i = 0; i < n; i++)<br />

for(j = 0; j < n; j++) {<br />

C[i][j] = 0;<br />

for(k = n-1; k >= 0; k--) {<br />

C[i][j] = C[i][j] +<br />

A[i][k] * B[k][j];<br />

}<br />

}<br />

}<br />

}<br />

O que faz essa função? Qual sua<br />

complexida<strong>de</strong> assintótica?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!