Skip to content

Commit

Permalink
recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
karan1205 committed Mar 5, 2022
1 parent cf41209 commit 9133211
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions DSA/recursion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Recursion

* A process (a function) that calls itself.

## The call stack
* It's a stack data structure.
* Any time a function is invoked it is placed (pushed) on the top of the call stack.
* When JavaScript sees the return keyword or when the function ends, the compiler will remove (pop)

## How recursive functions work
* Invoke the same function with a different input until you reach your base case!

## Base Case
* The condition when the recursion ends.

## Two essential parts of a recursive function!
* Base case
* Different Input
File renamed without changes.

0 comments on commit 9133211

Please sign in to comment.