
Guide to Recursion for Coding Interviews - samgh
https://www.byte-by-byte.com/recursion
======
jim-jim-jim
I didn't major in cs, but took a 101 level course for fun. It was taught with
Python. Never really got the unit on recursion. Made it through the work, but
I didn't feel comfortable actually using it in any future code.

Some time after graduating I bought a used copy of SICP and recursion clicked
for me as soon as it was introduced. The parenths, prefix notation, and notion
of evaluating expressions rather than returning values just made it seem so
much more natural.

This is probably an annoying comment since HN already has more than enough
Lisp wanking, but I wonder if other students also experienced hangups over
recursion because the course's language's syntax doesn't quite facilitate it
in the same way.

------
gabrielblack
The example is buggy. In a better version, both the parameter and the returned
type should be unsigned. With negative numbers, that don't make sense, the
program will crash. I don't think the interviewer will like it written in that
way :-)

