~/ learn/ comp-372/ cards/ What an algorithm is, and why efficiency matters
1 of 4

What two conditions must hold for an algorithm to be CORRECT?

What two conditions must hold for an algorithm to be CORRECT?

Answer

It halts in finite time, and it outputs the right answer — on every instance

Termination AND a correct output, for every problem instance. Missing either one (loops forever on some input, or sometimes wrong) makes it incorrect.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/6d5f35e3-d1af-4fe7-892b-7485e9db3edc/flashcard utf-8 LF