Question: 2 Recursive list evaluation 2 Points Grading comment: (MARK A SINGLE CHOICE) Given the following definition of function f, which choice of return value below
2 Recursive list evaluation 2 Points Grading comment: (MARK A SINGLE CHOICE) Given the following definition of function f, which choice of return value below will cause the expression f [1; 2; 3];; to return [1; 4; 9]? let rec f lst = match lst with | [] -> [] | head::rest -> (* choose one from below *);; Choice 1 of 9:(head+head) * f rest Choice 2 of 9:(head*head) * f rest Choice 3 of 9:(head+head) @ f rest Choice 4 of 9:[head*head] @ f rest Choice 5 of 9:[head+head] * f rest Choice 6 of 9:[head*head] * f rest Choice 7 of 9:(head*head) @ f rest Choice 8 of 9:[head+head] @ f rest Choice 9 of 9:None of the above whats the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
