/recursion

My solution to the Recursion exercises as part of The Odin Project

Primary LanguageRuby

recursion

My solution to the Recursion exercises as part of The Odin Project

What I learned

Wow. Recursion is a good way to melt your brain ;) I had already come accross recursion years ago when I learned Python and did Harvard's CS50 course, so it was a little disappointing that it was so difficult again. But I think this is one of those things that you have to do really often to fully internalize how it works. The unfortunate thing about Fibonacci is that really using recursion is NOT a good way to solve the problem -- you end up calculating the same cases over and over again which is not efficient. I'm glad that we had to also do merge sort, because that is a case when recursion actually makes problem solving more efficient.

Areas to improve

I wasn't able to solve the Fibonnaci problem entirely without loops -- in my version the n-th fibonacci number is determined recursively which the array is built using a loop. It will be a good opportunity to look at other students' code and learn from them.