Guide to Recursion for Coding Interviews(byte-by-byte.com)
byte-by-byte.com
Guide to Recursion for Coding Interviews
https://www.byte-by-byte.com/recursion
2 comments
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 :-)
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.