(Back to my home page).
My source of these is one particular mirror of The TeX Catalogue Online, Complete CTAN Edition (there seem to be tons of these on the web). NOTE: the versions of these files on my page might not be as up-to-date as the official CTAN versions.
I've found some different LaTeX style files that are all reasonable choices. Note that in some TeX systems, these may already be installed.
An example of the one I usually use, algorithmic.sty, along with Visio & some other stuff is here (it was for students taking an introductory theory of computation class I TA'd).
This package has recently gotten a number of improvements. I haven't tried the new package yet, but based on the manual, it has considerably more flexibility in layout, and the ability to use the standard latex \label and \ref commands to refer to line numbers.
Download from here
Comments & suggestions for improvement are requested here
The (possibly out-of-date) Postscript instructions for the package is here. The install directory on a random ctan mirror is here.
The (possibly out-of-date) Postscript instructions for the package is here. The CTAN page is here. A (possibly out-of-date) local copy of the tar/gzipped file to install this is here.
A (possibly out-of-date) copy of the documentation is here. The up-to-date entry at CTAN with the package is here (you'll have to wait for much of the page to load before it jumps to the right place).
Then you need to make sure your LaTeX system looks in those directories for .sty files (generally, if you put it under your main TeX directory, it'll work, but I'm no TeX expert). Other than that, you're done.
Here's an example of mine
for the algorithmic.sty file, in case your as LaTeX-naive as me:
\documentclass{article}
\usepackage{algorithmic}
\begin{document}
\title{Example algorithm document}
\author{Zasha Weinberg (zasha@cs)}
\maketitle
Consider the following algorithm for sorting.
The call $SlowSort(A,i,j)$ sorts the items
$A[i]\ldots A[j]$.
{\bf procedure} $SlowSort(A,i,j)$
\begin{algorithmic}[1]
\IF{$i\geq j$}
\STATE Return
\ENDIF
\STATE $m\gets \lfloor (i+j)/2 \rfloor$
\STATE $SlowSort(A,i,m)$
\STATE $SlowSort(A,m+1,j)$
\IF{$A[m]>A[j]$}
\STATE exchange $A[j],A[m]$
\ENDIF
\STATE $SlowSort(A,i,j-1)$
\end{algorithmic}
(This algorithm is due to Broder and Stolfi
[SIGACT News, Fall, 1984]).
\end{document}
A more complete example along with Visio & some other stuff is
here (it was for students taking an introductory
theory of computation class I TA'd).