Q8Numerical5 Marks1 Sep 2024
What will the value of S be at the end of the execution of the following pseudocode?
```
L1 = [1, -1, 5]
L2 = [3, 1, 2]
S = dosomething(L1, L2) - dosomething(L2, L1)
Procedure dosomething(X, Y)
if(length(X) != length(Y)){
return(0)
}
if(length(X) == 1 and length(Y) == 1){
return(first(X) * first(Y))
}
return(first(X) * last(Y) + dosomething(rest(X), init(Y)))
End dosomething
```
Press Enter to check.