13.04.2013 Views

Algoritmos e complexidade Notas de aula - Arquivo Escolar

Algoritmos e complexidade Notas de aula - Arquivo Escolar

Algoritmos e complexidade Notas de aula - Arquivo Escolar

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.

1. Introdução e conceitos básicos<br />

Complexida<strong>de</strong><br />

1.2x10 9<br />

1.0x10 9<br />

8.0x10 8<br />

6.0x10 8<br />

4.0x10 8<br />

2.0x10 8<br />

0.0x10 0<br />

0 100 200 300 400 500<br />

Tamanho do problema<br />

x 3<br />

10x 3<br />

4x 3 -3x 2 +2x-1<br />

Crescimento <strong>de</strong> funções<br />

n = 10 1<br />

10 2<br />

10 3<br />

10 4<br />

10 5<br />

10 6<br />

log2 n<br />

n<br />

3<br />

10<br />

7 10 13 17 20<br />

1<br />

10 2<br />

10 3<br />

10 4<br />

10 5<br />

10 6<br />

n log2 n 33 6.6 × 10 2<br />

10 4<br />

1.3 × 10 5<br />

1.7 × 10 6<br />

2 × 10 7<br />

n 2<br />

n 3<br />

2 n<br />

10 2<br />

10 3<br />

10 3<br />

10 4<br />

10 6<br />

Comparar eficiências<br />

16<br />

1.3 × 10 30<br />

10 6<br />

10 9<br />

1.1 × 10 301<br />

10 8<br />

10 12<br />

2 × 10 3010<br />

1 ano ≈ 365.2425d ≈ 3.2 × 10 7 s<br />

1 século ≈ 3.2 × 10 9 s<br />

1 milênio ≈ 3.2 × 10 10 s<br />

10 10<br />

10 15<br />

10 30103<br />

10 12<br />

10 18<br />

10 301030<br />

• Como comparar eficiências? Uma medida concreta do tempo <strong>de</strong>pen<strong>de</strong><br />

– do tipo da máquina usada (arquitetura, cache, memória, ...)

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

Saved successfully!

Ooh no, something went wrong!