QusAlgorithm A हमेशा terminate होता है लेकिन कभी-कभी incorrect output देता है; Algorithm B हमेशा correct output देता है लेकिन कुछ inputs के लिए terminate नहीं हो सकता। कौन-सा statement TRUE है?
A. A is preferable because it terminates
B. B is preferable because correctness is fundamental
C. Both satisfy algorithm correctness
D. Both violate essential properties of algorithms
Solution
D. Both violate essential properties of algorithmsExplanation
A valid algorithm should be both correct and finite. A lacks correctness; B lacks guaranteed termination.सही algorithm में correctness और finiteness दोनों आवश्यक हैं। A correct नहीं है और B सभी inputs के लिए terminate नहीं होता।