﻿ Some recursive exercises

### Some recursive exercises

Here are the Fibonacci and Noun-phrase discussions.

You must write recursive functions for each of the exercises below.  If you use more than one function to solve a problem (e.g. helper functions), at least one of the functions must be recursive.

1. Write sumdigits(n) which will add up the digits of the positive integer you're given.  Example: sumdigits(453) returns 12.

2. Write biggest(L) which will be given a non-empty list of numbers and will return its largest value.  You may not use the built-in max() or min() functions.

Optional problems:

3. Write ten2two(n) will change a non-negative integer n, into the base-2 representation of the number and return it.  You may not use strings in your algorithm.  Examples:
ten2two(4) -> 100
ten2two(13) -> 1101

4. Write baseConvert(n,inbase,outbase) which will be given a number in the base inbase and will return that number written in base outbase.  Both inbase and outbase will be in the range of 2 - 10.  Examples:
baseConvert(13,10,2) -> 1101
baseConvert(1101,2,10) -> 13
baseConvert(101,2,3) -> 12