
rovf
Veteran
Mar 29, 2010, 2:15 AM
Post #4 of 4
(3773 views)
|
Re: [siskos1] Recursive functions (an algorithm question)
[In reply to]
|
Can't Post
|
|
Sorry that I am too busy to research your code in detail, but one thing struck me: In your posting, you were asking for a recursive solution, and this is also what I proposed in my response; however, you are presenting now an iterative solution. I don't want to say that an iterative solution is necessarily bad; in contrary, there are many cases where the iterative solution has advantages. The recursive one is, however, usually easier to understand. I suggest that you try first a recursive one, and after this works, transform it to an iterative one. Ronald
|