jackpot@lemmy.ml to Programming · 11 months agowhen is it best to use a recursive function vs a for loopmessage-squaremessage-square52fedilinkarrow-up134arrow-down13
arrow-up131arrow-down1message-squarewhen is it best to use a recursive function vs a for loopjackpot@lemmy.ml to Programming · 11 months agomessage-square52fedilink
minus-squaremercator_rejectionlinkfedilinkarrow-up8·11 months agoAny recursive algorithm can be made iterative and vise versa. It really depends on the algorithm if the function calls are a major factor in performance.
Any recursive algorithm can be made iterative and vise versa. It really depends on the algorithm if the function calls are a major factor in performance.