Algorithm plagarism?
Plagiarism is using the words or ideas of another without proper credit.  So, if you don't give credit, you're plagiarizing.  If you do give credit, you're not.  It is really that simple.

In your particular case, there may be something else at work.  If your professor taught merge sort, and the assignment is to demonstrate that you know how to do it, then you might be in trouble for copying another's code even if you give proper credit; it's not plagiarism, but it still might not be allowed.   As Mad Jack has said in the comments, ask your professor.