[Tutor] Real world use of recursion

Danny Yoo dyoo at hashcollision.org
Wed Sep 10 19:55:02 CEST 2014


> Any code which walks a tree is almost certainly going to be using
> recursion. This is everything from a chess game analyser, to image
> processing software, to your browser when it's rendering a web page and
> much more in-between.

For the comment about Chess, see minmax for a concrete example:

    http://en.wikipedia.org/wiki/Minimax#Pseudocode

Note the recursion in the pseudocode.  Here, it's used to power the
basic concept of "If I make this move, and my opponent makes this
move, and I respond with this move, and they make that move..."


For a concrete example with image processing: the "color quantization"
problem with Octrees:

    http://en.wikipedia.org/wiki/Octree


More information about the Tutor mailing list