Question 1
doSomething is a procedure that accepts a list of integers as input.
S = doSomething(L)Procedure doSomething(L) if (length(L) ≤ 1) { return(0) } else { return(first(L)-last(L) + doSomething(init(rest(L)))) }End doSomethingBased on the above data, answer the given subquestions.
What will the value of S at the end of execution when L = [3, 2, 1, 0, 1, 2, 3]?
0
1
12
Error in the pseudocode
