~/ learn/ comp-372/ cards/ COMP 372 — Design & Analysis of Algorithms
1 of 289

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/83961f6e-3e86-40fd-bf12-4e1f862048ee/flashcard utf-8 LF