Skip to content

Commit ef9b750

Browse files
authored
Create README.md
1 parent c29e3a9 commit ef9b750

File tree

1 file changed

+21
-0
lines changed
  • Competitive Coding/Math/Catalan_Numbers

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The 2 different programs in this folder contain the same implementation!
2+
The programs basically are a python implementation of the Catalan Numbers.
3+
They're similar to Fibonacci (very slightly)
4+
5+
The 2 different implementations vary only in terms of time taken!<br>
6+
Basically we can implement in 3 different ways!<br>
7+
8+
(1) Recursively <br>
9+
(2) Dynamic Programming <br>
10+
(3) Binomial Coefficient <br><br>
11+
12+
Each of the above 3 implementations have a descending order of time complexities from (1) to (3) <br><br>
13+
14+
For (1) the time complexity is exponential<br>
15+
For (2) the time complexity is O(n^2)<br>
16+
For (3) the time complexity is O(n)<br><br>
17+
18+
The Binomial implementation has the best time complexity while the Recursive implementation has the worst time complexity<br>
19+
In this folder we have the Binomial and Recursive implementations of Catalan Numbers.<br><br>
20+
21+
Sources : https://www.geeksforgeeks.org/program-nth-catalan-number/ (You can have a look at this to know more about Catalan number implementations and its theory.)

0 commit comments

Comments
 (0)