- Write a recursive function to compute the length of a list.
- Write a recursive function to compute the sum of a list of numbers.
- Write a recursive function to compute the sum of a binary tree of numbers.
- Write a recursive implementation of the
map
function. - Write a recursive implementation of the
filter
function. - Write a recursive function that inserts an element in the right place into a linked list. The function should return a new linked list rather than mutate the original list.
- The change counting problem from SICP: http://mitpress.mit.edu/sicp/full-text/sicp/book/node16.html
- Write a recursive function that enumerates the nodes of a tree in depth-first {pre|in|post} order.
- Write a recursive function that computes the "power set" of a set.
- Write a recursive function that computes the number of ways of distinct k-element subsets of a set with n elements. In other words, "n choose k".
- Explicitly compute (rather than just counting) all k-element subsets of a set.
- Write a recursive function that generates all possible partitions of a set.
- Write a recursive function that calculates the minimax "value" of a board in Tic-Tac-Toe :)
Last active
December 25, 2015 21:49
-
-
Save cqfd/7045316 to your computer and use it in GitHub Desktop.
Recursion!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment