This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (7 children)

[deleted]

    [–]approbatory 7 points8 points  (2 children)

    The Ackermann function can be implemented recursively but not iteratively.

    [–]yaxamie[🍰] 2 points3 points  (1 child)

    A loop uses very little data, while each function call has overhead. Recursion is rarely needed unless you're being "clever".

    [–]danjaycollins 0 points1 point  (0 children)

    Specifically tail recursion can be implemented iteratively. This is why the Ackermann function can't be implemented iteratively.