in reply to Re: fibonacci numbers using subroutine?
in thread fibonacci numbers using subroutine?

30 years ago, when I was a student, one of the researchers told me about quicksort. He told me that to sort a list, I should split it in to two lists, sort each list, and repeat. That was when I recognised the beauty of recursion.
While quicksort splits the list into two, as you describe it, it sound more like merge sort. The essence of quicksort is that you partition the list using a pivot element.
Recursion can lead to some wonderfully beautiful solutions to programming problems, but not always efficiently. Memoize can often increase their efficiency greatly, so take a look at that too.
I'd say that if memoizing your recursive function speeds it up significantly, it's likely there's a more efficient iterative solution.
  • Comment on Re^2: fibonacci numbers using subroutine?