13.04.2013 Views

Análise de complexidade - UFMG

Análise de complexidade - UFMG

Análise de complexidade - UFMG

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

-<br />

-<br />

-<br />

1<br />

n<br />

n(n+1)/2 ?<br />

n(n+1)/2 ?<br />

1<br />

-<br />

void exemplo(int n)<br />

{<br />

int i, j;<br />

int a = 0;<br />

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

for(j = n; j > i; j--)<br />

a += i + j;<br />

exemplo1(n);<br />

}<br />

Qual a complexida<strong>de</strong> assintótica da função<br />

exemplo?

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

Saved successfully!

Ooh no, something went wrong!