How to reuse algorithms from previous paper
You can create a Preliminaries section, and include Algorithm A and its explanation there clearly citing it. That way, it is clear to the reader that the second contains necessary background information, and not new contributions.

As far as how much to include, that really depends on how crucial it is for understanding of expansion of B, how much space you have available, whether the algorithm is published. Any other approaches you suggest are viable.