Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.64 KB

recursion.md

File metadata and controls

34 lines (23 loc) · 1.64 KB

Recursion

The Concept

The ability to define a function that calls itself, see recursion

What to cover

  • What is recursion? Wwhat is recursion? When should it be used?
  • What forms or recursion are supported?: Are recursive functions supported? Recursive types? Does the language supports tail recursion?
  • Using recursion: How can recursive functions/types be defined?

Exercises

Ordering pizzas

This exercise handles ordering pizzas. The reference implementation (F#) teaches:

  • Know what recursion is.
  • Know how to define a recursive function.
  • Know how to define a recursive type.
  • Know how to write a tail-recursive function.
  • Know how to recursively process lists.

Implementations

Track Exercise Changes
F# recursion None
JavaScript recursion Allow for multiple extra topping, or extra sauces, don't use pattern matching but list destructuring & iteration