More general kinds of recursion

[comp1110-7L]

The recursive functions we have seen so far directly matched the structure of a data type definition. Sometimes, such a structure is less obvious, and sometimes, we don't follow the structure of a data type that closely. But as long as you can argue that a recursive call is on "smaller" input (in the sense that we get close to a base case), recursion is a good option.

bars magnifying-glass caret-down plus minus arrow-right xmark