aarklon@gmail.com wrote:
> Hi all,
>
> can any one give a example program where recursive version is faster
> than iterative version ?
For trivial programs there may or may not be examples where recursion is
faster.
But recursion is a natural fit for many kinds of programming which would be
a pain to implement with iterative methods.
Especially with making arrangements to save/restore complex data which may
well end up slower than just using recursion. But even if recursion was
slower, the difference would be minimal in a real application, while keeping
the code much cleaner.
--
Bartc