diff --git a/exercises/concept/pizza-order/.docs/about.md b/exercises/concept/pizza-order/.docs/about.md new file mode 100644 index 0000000000..67ac0f6694 --- /dev/null +++ b/exercises/concept/pizza-order/.docs/about.md @@ -0,0 +1,9 @@ +### About Recursion + +Recursion is a programming technique where a function calls itself to solve smaller instances of the same problem. It’s a powerful tool for breaking down problems that can be divided into smaller, similar sub-problems. However, recursion can quickly run into issues such as **Memory Allocation Errors** or **Maximum Call Stack Size Exceeded** if not handled carefully. + +In JavaScript, one important limitation is the **lack of Tail-Call Optimization (TCO)**. Tail-call optimization allows the language engine to reuse the stack frame for recursive calls when they occur at the end of a function. Unfortunately, JavaScript does not support TCO, which means that deeply nested recursive calls can lead to a stack overflow. + +### Interesting Facts: +- Recursion is widely used in problems such as tree traversal, factorial calculation, and Fibonacci sequences. +- JavaScript does not optimize tail calls, unlike other languages such as Scheme or Haskell.