Follow both algorithms using N as the input number:
Algorithm A: N -> N + 1 -> 2(N + 1) = 2N + 2
Algorithm B: N -> 2N -> 2N + 2
Each algorithm produces the same output, as long as you're willing to trust that the distributive property is always true! If you don't trust or remember the distributive property, remember that 2(N + 1) is the same as (N + 1) + (N + 1).
Most algebra students would classify them as identical, since they determine identical expressions. But the steps are different -- it's like giving two sets of directions to the same place. Certain problems have many different algorithms of solution, some much more difficult than others.