Turn a recursive Function into a stack base

Posted 23 March 2011 - 05:03 PM

hi i have been asked to turn a recursive function into a stack base but i am not sure what that's mean but i choose the fibonacci recursive function and i turned it into the stack base ?? is this the right way or the right example to answer this question ?

Re: Turn a recursive Function into a stack base

Posted 25 March 2011 - 06:12 AM

Thank you for your reply but actually i have not been asked by my teacher , i have interview it will take place after a week from now !! and they told to prepare really well !! one of the thing that i need to know is how to turn e recursive into a stack base no matter what the language that you will use so that's why i am not sure what exactly that's mean

Re: Turn a recursive Function into a stack base

Posted 25 March 2011 - 06:46 AM

Try implementing the QuickSort Algoritm in a single function,
without using recursion. You do this by keeping a list of ranges
you still need to divide, and repeat the algoritm in a while loop
till the list is empty.

This is usually done for increased performance, as recursive algoritms
put a really big pressure on the (Function)Stack.