173k views
4 votes
What is the primary difference between an algorithm and a heuristic?

A. A heuristic guarantees a solution; an algorithm does not.

B. An algorithm guarantees a solution; a heuristic does not.

User ReNiSh AR
by
8.4k points

1 Answer

3 votes

Final answer:

An algorithm provides step-by-step instructions while a heuristic is a general problem-solving framework or mental shortcut.

Step-by-step explanation:

An algorithm is a problem-solving formula that provides step-by-step instructions to achieve a desired outcome. It is like a recipe with specific instructions that yield the same result every time. On the other hand, a heuristic is a general problem-solving framework or mental shortcut that is used to solve problems. It is a rule of thumb that saves time and energy, but may not always lead to the best solution.

User Shawnee
by
7.9k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.