Title | Algorithm Correctness |
---|---|
Author | Riyadh Menacer |
Course | Algorithms Correctness and Efficiency |
Institution | University of Nottingham |
Pages | 2 |
File Size | 47.6 KB |
File Type | |
Total Downloads | 110 |
Total Views | 172 |
Correctness...
Algorithm Correctness Key points 1. What is Correctness 2. Correctness vs Testing 3. Assertions
What is Correctness An algorithm is a series of steps which are used to solve a computational problem in finite time. An algorithm will take value(s) as input and return value(s) as output. An algorithm is correct if for every legal input given to an algorithm, the algorithm produces the correct output. For example 1. Max(a, b) is correct if it always returns the larger value out of a, b. 2. Max(int[] A) is correct if it always returns the largest integer found in array A. That is it returns A[i] such that 0...