Algorithms

By Ethan Shine

Definition of Algorithm:

In mathematics and computer science, an algorithm is a sequence of instructions, typically to solve a class of problems or perform a computation. Algorithms are unambiguous specifications for performing calculation, data processing, automated reasoning, and other tasks.

Wikipedia Webpage

Algorithms are an essential part of Computer programming. They allow a computer to complete tasks to a certain specification.

Algorithm comparisson

I think algorithm B is better than algorithm A. This is because of the fact that with A, the user has to input the elif statement perfectly in order to get a response. In B, each response is given a number so all you have to do is type the number. If the user doesn't type the number, then the algorithm tells the suer that they just had to type 1 or 2. While B might be longer, it is easier to read and understand as well as easier to operate.