Recursion is costlier (in terms of resource usages) then iteration if everything else is same. Having said that many compilers covert recursive code to iterative as part of optimization so life is easy and you can enjoy the power of recursion in place of using long code of iterative methods.