12.07.2015 Views

Cap. 4 Complejidad temporal de algoritmos - Inicio

Cap. 4 Complejidad temporal de algoritmos - Inicio

Cap. 4 Complejidad temporal de algoritmos - Inicio

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.

16 Estructuras <strong>de</strong> Datos y AlgoritmosEl siguiente algoritmo ha sido tradicionalmente usado en procesadores que no tenganimplementada una unidad <strong>de</strong> multiplicación <strong>de</strong> enteros en hardware.//Retorna cuociente q y resto r. Con n = q*d + r .unsigned int divi<strong>de</strong>log(unsigned int n, unsigned int d, unsigned int *r){ unsigned int dd=d, q=0;*r = n;while (dd d){ dd/=2; q= q*2;if (dd

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

Saved successfully!

Ooh no, something went wrong!