Algorithm In mathematics and computer science, an algorithm is a step-by-step procedure for calculations.