As I practice competitive programming more and more (and thus implement more and more algorithms), I've begun to have somewhat of a worry that I'm developing the bad habit of favoring recursive implementations to iterative ones. I've mainly implemented DFS/DP/Backtracking recursively this far, and that has made those methods of implementation come much more naturally to me. However, pretty much all study material recommends iterative solutions over recursive ones for the lower constant factors they usually have. This has made me wonder if it would be worth pushing myself to think of the iterative implementations instead of the (to me, more intuitive) recursive ones when solving problems. Has the difference in complexity between the two ever made a difference in competitive programming contests? What about outside of the CP scene? In working environments where efficiency is a major concern, are iterative solutions generally that much better than recursive ones?



