Buying algorithms vs. programming

I'd like to ask for some experienced opinions on buying algorithms vs. programming them. Which do you think is more cost effective? There are firms that offer tested algorithms for sale at a yearly cost, and can be downloaded into your code. If you consider the cost of programmers, it would seem a viable option.

Comments

Yes in most cases you can and should bye sofware instead of starting programming from point 0. In Sweden with have around 70 000 programmers (resulting in 128 inhabitants/programmer). Some tasks are of course very specific so starting from scratch is needed.Most countries have some language problem. For Sweden it is