I made some tests and I guess the problem is definetly related to
package hyperref:
\usepackage[bookmarks]{hyperref}
If I don't use it, and remove following code, no problem:
\addcontentsline{toc}{chapter}{Indice}
\listoffigures \addcontentsline{toc}{chapter}{Elenco delle figure}
\listoftables \addcontentsline{toc}{chapter}{Elenco delle tabelle}
I think there's something that messes up things with the algorithm stuff...
Regards,
Diego
