06.05.2013 Views

presentación-PDF

presentación-PDF

presentación-PDF

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.

Complejidad Ordenación por Inserción<br />

CASO PEOR: Cuando<br />

el array está ordenado<br />

inversamente.<br />

Ej. 86 52 45 20 n=4<br />

52 86 45 20<br />

45 52 86 20<br />

20 45 52 86<br />

En general, para n<br />

elementos se realizan<br />

(n-1) intercambios y<br />

(n-1) comparaciones.<br />

Por tanto, O(n 2 ).<br />

Pasada Nº de<br />

Intercambios<br />

1 1 1<br />

2 2 2<br />

3 3 3<br />

Nº<br />

Comparacion<br />

es

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

Saved successfully!

Ooh no, something went wrong!