
2 Nov
2015
2 Nov
'15
1:36 a.m.
On 30/10/2015, at 8:05 pm, Roelof Wobben
Now I have to think about how to read the values of f 1 .. fn 2 .
You "read the value of f 1" by calling f 1.
I think I need 2 recursive function . One for g x and one for reading f1
NO. You were told to write *A* recursive function. That's ONE recursive function. That's all you need. g 0 = the maximum of [f 0] = what? g n = the maximum of [f 0, f 1, ..., f (n-1), f n] Now, DO YOU KNOW A FUNCTION THAT YOU CAN CALL TO COMPUTE the maximum of [f 0, f 1, ..., f (n-1)] ? Can you see HOW TO COMBINE that answer with f n to get the final result you want? Is there a function MENTIONED IN THE PROBLEM that could do this last step?