jackpot@lemmy.ml to Programming@programming.dev · 10 months agowhen is it best to use a recursive function vs a for loopmessage-squaremessage-square39fedilinkarrow-up10arrow-down10
arrow-up10arrow-down1message-squarewhen is it best to use a recursive function vs a for loopjackpot@lemmy.ml to Programming@programming.dev · 10 months agomessage-square39fedilink
minus-squaremercator_rejection@programming.devlinkfedilinkarrow-up0·10 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.