# Choosing

Choosing: 5,000 Folders Deep: Recursion or a Loop?, Asking the Same Question Twice: Memoization.

Updated: November 17, 2026

1. [5,000 Folders Deep: Recursion or a Loop?](https://www.ask-codey.com/lessons/ds-recursion-vs-loops) (Journeyman): Keep the folder tool working on a folder thousands of levels deep, where recursion runs out of call stack: why a bigger limit and a plain loop both fall short, how a loop with a pile of its own does the job, and how to choose between recursion and a loop for any task.
2. [Asking the Same Question Twice: Memoization](https://www.ask-codey.com/lessons/ds-memoization) (Journeyman): Speed up a recursive function that answers 10 stairs at once, 40 in half a minute and 50 in about an hour: why a faster computer and a loop with your own stack don't help, where the time really goes, and how writing each answer down, memoization, makes it instant.

Source: https://www.ask-codey.com/courses/data-structures/topics/ds-choosing
