Tag Archives: recursion

Mth to last – a recursive approach in Python

A collegue of mine was pondering the mthToLast problem for a LinkedList I’d blogged about previously and sent me the following IM message: just a guess – but can you use recursion to solve your link list m problem? a … Continue reading

Posted in programming | Tagged , , , | Leave a comment

Reverse a string using recursion in Python

I’ve always found recursion somewhat unnatural to think about, but somehow satisfying when I can see it unfolding in my mind – this simple exercise in reversing a string using recursion is a case in point… >>> def reverse(str): if … Continue reading

Posted in programming | Tagged , , | Leave a comment