Skip to content

Commit bb2132d

Browse files
Merge pull request #54 from mybrainishuge/master
Minor readme rewording
2 parents 33bc4a8 + 3caa1d1 commit bb2132d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This is a repository of toy problems to be solved using recursion and JavaScript
1414

1515
> Pseudocode helps you focus on the algorithm instead of getting distracted by syntax.
1616
17-
- This repo requires each function call itself recursively and pays no attention to whether inner recursive functions defined and called.
17+
- This repo requires each function call itself recursively and pays no attention to whether inner recursive functions are defined and called.
1818

1919
> While both are valid uses of recursion, there are important lessons to learn by following the method this repo enforces. Defining inner functions and calling them recursively relies on side effects, while following the more pure approach requires an understanding of how values are passed through the call stack.
2020
@@ -44,10 +44,10 @@ Is it a true definition? Mostly. Recursion is when a function calls itself. A re
4444
_What does this all mean?_ Let's consider a silly example:
4545
```sh
4646
function stepsToZero(n) {
47-
if (n === 0) { // base case
47+
if (!n === 0) { /* base case */
4848
console.log('Reached zero');
4949
return;
50-
} else { // recursive case
50+
} else { /* recursive case */
5151
console.log(n + ' is not zero');
5252
return stepsToZero(n-1);
5353
}
@@ -83,6 +83,6 @@ Recursion isn't unique to any one programming language. As a software engineer,
8383
8484
8585
### Divide and Conquer
86-
Recursion is often used in _divide and conquer_ algorithms where problems can be divided into similar subproblems and conquered individually. Consider traversing a tree structure. Each branch may have its own "children" branches. And every branch is essentually just another tree which means, as long as child trees are found, we can recurse on each child.
86+
Recursion is often used in _divide and conquer_ algorithms where problems can be divided into similar subproblems and conquered individually. Consider traversing a tree structure. Each branch may have its own "children" branches. Every branch is essentually just another tree which means, as long as child trees are found, we can recurse on each child.
8787
8888
[inception]: <https://en.wikipedia.org/wiki/Inception>

0 commit comments

Comments
 (0)