jackpot@lemmy.ml to Programming@programming.dev · 11 months agowhen is it best to use a recursive function vs a for loopmessage-squaremessage-square49fedilinkarrow-up132
arrow-up132message-squarewhen is it best to use a recursive function vs a for loopjackpot@lemmy.ml to Programming@programming.dev · 11 months agomessage-square49fedilink
minus-squareFaresh@lemmy.mllinkfedilinkEnglisharrow-up5·11 months agoRecursion is never more efficient than the best equivalent iterative solution. Recursion however allows you to solve some problems very easily and very neatly.
Recursion is never more efficient than the best equivalent iterative solution. Recursion however allows you to solve some problems very easily and very neatly.