Design Patterns – Difference Between a Design Pattern and an Algorithm

algorithmsdesign-patternsdifference

From Wikipedia:

In mathematics and computer science, an algorithm is an effective
method expressed as a finite list of well-defined instructions for
calculating a function.

In software engineering, a design pattern is a general reusable
solution to a commonly occurring problem in software design.

By description (assuming they are correct on Wikipedia), it appears that Algorithm and Design Pattern are somewhat similar/the same. They both achieve the task of solving a problem and both are certainly reusable if properly implemented.

Does it make any sense to compare them to evaluate differences between them?

Best Answer

A binary search is a design pattern. It's a problem that pops up all the time and the same pattern (binary search) solves it.

There is no difference between design patterns and algorithms from a mathematical level. Now if your talking to another human you should probably not say this because they are not capable of reducing ideas to their base components. Just like you shouldn't tell a math guy that all math is just basic addition (even though it's true).