?/100

Getting around the recursion limit

December 19, 202222688

Description

Get rid of recursion with this trick! Recursion is great, an extremely useful tool to have a mastery of. However, recursion is limited by the depth of the allowed call-stack before an error is caused. Sometimes, depth is not a problem. But other times, it is better to convert your recursive algorithm into an iterative one by manually managing your own stack, which is what we'll see in this Python video. ā€• mCoding with James Murphy (https://mcoding.io) Source code: https://github.com/mCodingLLC/VideosSampleCode SUPPORT ME ā­ --------------------------------------------------- Sign up on Patreon to get your donor role and early access to videos! https://patreon.com/mCoding Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.) https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE Want to donate crypto? Check out the rest of my supported donations on my website! https://mcoding.io/donate Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information BE ACTIVE IN MY COMMUNITY šŸ˜„ --------------------------------------------------- Discord: https://discord.gg/Ye9yJtZQuN Github: https://github.com/mCodingLLC/ Reddit: https://www.reddit.com/r/mCoding/ Facebook: https://www.facebook.com/james.mcoding CHAPTERS --------------------------------------------------- 0:00 Traversing a tree 2:04 The trick 3:41 More complex example with max depth 5:07 Decoupling

Wheatcha