Short Answers Section 1.1 Specification, Design, Implementation |
public static void exam(int i) // Precondition: i is not equal to 42. ...
Short Answers
Section 1.2
Running Time Analysis
Time Formula | Big-O |
---|---|
10n | . |
2n² | . |
3 times log (base 2) of n | . |
2n² + 10n | . |
Multiple Choice Section 1.1 Specification, Design, Implementation |
if (0 < x) throw new IllegalArgumentExcpetion("Bad x");
if (0 == x) throw new IllegalArgumentExcpetion("Bad x");
if (0 > x) throw new IllegalArgumentExcpetion("Bad x");
Multiple Choice
Section 1.2
Running Time Analysis
while (n > 0) { n = n/10; // Use integer division }What is the worst-case time analysis for the above loop?
Multiple Choice
Section 1.3
Testing and Debugging