jackpot@lemmy.mlBanned to Programming · 2 years agowhen is it best to use a recursive function vs a for loopmessage-squaremessage-square52linkfedilinkarrow-up134arrow-down13
arrow-up131arrow-down1message-squarewhen is it best to use a recursive function vs a for loopjackpot@lemmy.mlBanned to Programming · 2 years agomessage-square52linkfedilink
minus-squaremercator_rejectionlinkfedilinkarrow-up8·2 years 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.