What are the trade-offs between using a recursive solution versus an iterative one for this specific algorithm?