Recursive algorithm

This is a non-stack consuming recursive approach if you are interested.  Thanks for an informative class!