General
Material
Lecture 1
Lecture 2
Lecture 3
Lecture 4
Lecture 5

Hint

This is again a case of traversing an input list and doing something to each element of the input list. The interesting thing is that you have two input lists which have to be traversed in parallel.

To get to the solution, ask yourself the following questions:

  • What is the base case? I.e. what should the input lists look like for recursion to stop?
  • What should the result look like in the base case.
  • What should it look like in the recursive case? Or how should the result be computed in the recursive case?

Solution

Back to the exercise.