Skip to content

Commit df04d94

Browse files
vysorpoyea
authored andcommitted
Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (TheAlgorithms#763)
* Renaming directories * Adding a recursive factorial algorithm
1 parent 48bba49 commit df04d94

36 files changed

+13
-0
lines changed

Graphs/BFS.py graphs/BFS.py

File renamed without changes.

Graphs/DFS.py graphs/DFS.py

File renamed without changes.

Graphs/a_star.py graphs/a_star.py

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Graphs/graph.py graphs/graph.py

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Maths/3n+1.py maths/3n+1.py

File renamed without changes.

Maths/FindMax.py maths/FindMax.py

File renamed without changes.

Maths/FindMin.py maths/FindMin.py

File renamed without changes.

Maths/abs.py maths/abs.py

File renamed without changes.

Maths/absMax.py maths/absMax.py

File renamed without changes.

Maths/absMin.py maths/absMin.py

File renamed without changes.

Maths/average.py maths/average.py

File renamed without changes.
File renamed without changes.

maths/factorial_recursive.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def fact(n):
2+
"""
3+
Return 1, if n is 1 or below,
4+
otherwise, return n * fact(n-1).
5+
"""
6+
return 1 if n <= 1 else n * fact(n-1)
7+
8+
"""
9+
Shown factorial for i,
10+
where i ranges from 1 to 20.
11+
"""
12+
for i in range(1,21):
13+
print(i, ": ", fact(i), sep='')
File renamed without changes.

0 commit comments

Comments
 (0)