Skip to content

Instantly share code, notes, and snippets.

View smirnoffs's full-sized avatar
🇺🇦
2 hours from the idea to production

Sergii Smyrnov smirnoffs

🇺🇦
2 hours from the idea to production
  • Aiven
  • Berlin, Germany
View GitHub Profile
@tmoertel
tmoertel / gist:5798134
Last active September 18, 2025 20:18
How to transform the vanilla recursive fib function into the iterative DP version through a series of mechanical steps.
# Transforming the vanilla recursive fib into the iterative DP version
# through a series of mechanical steps.
#
# For more on converting recursive algorithms into iterative ones, see:
# http://blog.moertel.com/posts/2013-05-11-recursive-to-iterative.html
# original function
def fib(n):