What is?
Im afraid I dont grok the relevence of closures as iterators to convert recursive routines to iterative ones. But to answer your question a typical example where converting recursive routines to iterative is requie is to implement Firstkey/Nextkey in a hash that ties to a tree-like structure.
Simply implementing the classic inorder() function of binary trees iteratively is a good learning example.
In reply to Re: Recursive to Iterative using Closures (Fun with Fibonacci)
by demerphq
in thread Recursive to Iterative using Closures (Fun with Fibonacci)
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |