TeleTrader interview question

Convert recursive method to iterative.