Non Recursive Implementation Of Recursive Algorithm