[prev] 36 [next]

Recursive Operations on Lists

Many data structures can be viewed recursively, e.g.
  • a list is comprised of
    • a head   (an item)
    • a tail   (a list)
  • a list may be empty   (no items)
Functions on such structures can be expressed recursively.

Such functions are often much simpler than iterative counterparts.