Recursion vs. Iteration Homework Help
For these good examples, it is easily develop a good iterative version of the same algorithm that will run quicker. In fact recursion and iteration are related; languages without iteration simulate it utilizing recursion and vice versa.
However, more interesting examples, like the sorting routines we discuss later, don't have a clear iterative solution. Whenever a solution is discovered, it is often much longer than the recursive version.
The same is true for algorithms based on recursively-defined data structures, such as the Binary Tree ADT.