Non Recursive Implementation Of A Recursive Algorithm