EPAM Systems interview question

Convert recursive algorithm to iterative and vice versa