Is copying an algorithm plagiarism?
Plagiarism is passing someone else's work as your own. If the source is referenced, then there is no plagiarism. 

Quoting the whole algorithm verbatim may be considered as bad writing style, may be against a particular journal's rules, or may simply demonstrate a certain lack of creativity. However, this is not a plagiarism, as long as the source is cited.