[Tutor] recursion

Alan Gauld alan.gauld at yahoo.co.uk
Mon Aug 15 19:23:46 EDT 2022


On 15/08/2022 18:19, Mats Wichmann wrote:

>> There are things like traversing trees which are harder to do without
>> recursion but Fibonacci is absolutely trivial to do 

The other common recursion function is factorial() and
that too is nearly trivial to do non-recursively. But
traversing trees etc and other real-world uses of
recursion are a lot harder to teach! (You need to teach
trees for a start!)

I suspect the problem is that recursio is introduced
too early in the curriculum, but teachers like it
because it's cool from an academic standpoint and
can help teach a regular approach to designing programs.
(see the online book "How to Design Programs" for
an example of the approach...http://htdp.org)

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list