Skip to content

Commit

Permalink
docs: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ming-tsai committed Aug 20, 2022
1 parent 9a74c3e commit d34acc7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion algorithms/C/maths/fibonacci-number/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Fibonacci Number
Fibonacci numbers form a Fibonacci sequence where given any number (excluding first 2 terms) is a sum of its two preceding numbers. Usually, the sequence is either start with 0 and 1 or 1 and 1. Below is a Fibonacci sequnce starting from 0 and 1:
Fibonacci numbers form a Fibonacci sequence where given any number (excluding first 2 terms) is a sum of its two preceding numbers. Usually, the sequence is either start with 0 and 1 or 1 and 1. Below is a Fibonacci sequence starting from 0 and 1:

$$
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, \dots
Expand Down
4 changes: 2 additions & 2 deletions algorithms/CPlusPlus/Maths/factorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ A factorial of number 4 is calculated as:
4 X 3 X 2 X 1 = 24
Approach: Calculating factorial using for loop.
Declaring the f varialbe to 1 (not initialising it to zero because any number multiplied by 0 will be 0)
Multiplying the f variable to 1,2,3...n and storing it in the f varialbe.
Declaring the f variable to 1 (not initialising it to zero because any number multiplied by 0 will be 0)
Multiplying the f variable to 1,2,3...n and storing it in the f variable.
The same factorial can be calculated using while loop, recursion.
Time Complexity: O(number)
Expand Down
2 changes: 1 addition & 1 deletion algorithms/CPlusPlus/Recursion/first-uppercase-letter.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Description: Program to print the first uppercase letter in a string
Approach: Use a varialbe to iterate over the string
Approach: Use a variable to iterate over the string
Increment the iterator by 1 at every recursive call
If the value of iterator reaches till the length of the string, return '\0
Expand Down

0 comments on commit d34acc7

Please sign in to comment.