Skip to content

Commit

Permalink
add about.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KaranAgraharee committed Jan 13, 2025
1 parent d4b91b3 commit c56bfe9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions exercises/concept/pizza-order/.docs/about.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit c56bfe9

Please sign in to comment.