For all the functions in this assignment I want you to write a recursive function. Note, that even moreso than in the first recursion problem set, many of these functions are not ones that you'd naturally write recursively. This is an exercise in making sure you understand how recursion works so you can use it on problems where it is a natural way to express things.

As in the previous assignment, for functions the recurse on arrays, you may want to use the fact that s.slice(1) returns an array consisting of all but the first element of xs. E.g. [2, 3, 5, 7, 11].slice(1) evaluates to a new array [3, 5, 7, 11]. Similarly you can recurse on strings using s.substring(1) to get the string containing all but the first character of s.

Put definitions here.

Revisions: