I would recommend to typeset them in LaTeX boxes (inside LyX) using: - algorithmic, see http://en.wikibooks.org/wiki/LaTeX/Algorithms_and_Pseudocode - clrscode, see http://www.cs.dartmouth.edu/~thc/clrscode/
I have some examples with clrscode, if you wish them ... -- Andrés