An algorithm is complete if ____________ A. It terminates with a solution when one exists B. It starts with a solution C. It does not terminate with a solution D. It has a loop

[amp_mcq option1=”It terminates with a solution when one exists” option2=”It starts with a solution” option3=”It does not terminate with a solution” option4=”It has a loop” correct=”option1″]

The correct answer is: A. It terminates with a solution when one exists.

An algorithm is complete if it always terminates with a solution, if one exists. In other words, it will always stop running and give you an answer, even if that answer is “no solution exists.”

Option B is incorrect because an algorithm does not need to start with a solution. It can start with any input and still be complete if it always terminates with a solution.

Option C is incorrect because an algorithm can terminate without finding a solution. In this case, it is said to have “failed to find a solution.”

Option D is incorrect because an algorithm does not need to have a loop to be complete. A loop is simply a construct that allows an algorithm to repeat itself. It is not necessary for an algorithm to be complete.