yes. You should be able to convert any recursive function/method to a non-recursive one by just simulating what the language does to do the recursion. This usually involves using stack (recursion stack) to store function local variables before doing another call. Haven't looked at this closely but the procedures looks similar. http://www.cmpe.boun.edu.tr/~akin/cmpe160/recursion.html
Note also, after conversion, you should revise the code to see if you can get rid of some variables/stacks. For example for a Fibonacci recursive function, you should end up the non-recursive one by having only for loop without the need of any stack. Regards, Youssef On Jun 6, 8:40 pm, "zee 99" <[EMAIL PROTECTED]> wrote: > hi > > learnt that a tail recursive algorithm can be converted to a non recursive > one by merely using a while and a goto > > is it true for all class of recursive algorithms or just the tail recursive > ones ... > > if all recursive ones can be converted , then do we have a general procedure > ??? > > thanks > > zee --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---