Consider the “maximum” problem: given an array of numbers, return the maximum element of that array. Complete the formal specification for this problem by finishing the specification under “output”: Input: An array A[1 . . . n], where each A[i] ∈ Z. Output: An integer x ∈ Z such that . . .
Let T = {1, . . . , 12} × {0, 1, . . . , 59} denote the set of numbers that can be displayed on a digital clock in twelve-hour mode. (A clock actually displays a colon between the two numbers.) We can think of a clock as a function c : T → T, so that when the real time is t ∈ T, then the clock displays the time c(t). (For example, if fastby7 runs seven minutes fast, then fastby7(12:00) = 12:07.)
hen fastby7(12:00) = 12:07.) For several of these questions, it may be helpful to make use of the function add : T × Z≥0 → T so that add(t, x) denotes the time that’s x minutes later than t.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here