@DmitrySavostyanov is right in that what matters is that you reference where you got the algorithm from. If you do so, then copying it verbatim is in essence a quote, not plagiarism.
I disagree with him, though, on whether it is good or bad style to copy algorithms verbatim. Algorithms -- especially when giving in short "pseudo-algorithm" form, are concise, technical statements in much the same way as formulas are. There is typically no literary component to it. As such, there is little leeway in rephrasing something to make it your own, other than the gratuitous use of different variable or function names. The latter, however, is not helpful, but rather only serves to confuse readers trying to compare papers. Consequently, I'm all for copying verbatim, as long as it is clear where it comes from.
So, say something like "The problem above is easily solvers by the algorithm of Miller and Smith , which is reproduced in the following: [...]".