• coloredgrayscale@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    A naive iterative implementation would be by adding and removing the folders/files from a list.

    If tail call optimization works on the (recursive) example then that’s (kinda) the compiler turning a recursive function into a loop.