Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 2 different implementations for Catalan Numbers #255

Merged
merged 9 commits into from
Dec 31, 2017
10 changes: 3 additions & 7 deletions Competitive Coding/Math/Catalan_Numbers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ They're similar to Fibonacci (very slightly)
The 2 different implementations vary only in terms of time taken!<br>
Basically we can implement in 3 different ways!<br>

(1) Recursively <br>
(2) Dynamic Programming <br>
(3) Binomial Coefficient <br><br>
* Recursively - Exponential time complexity<br>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make use of tilde

like this O(n^2)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* Dynamic Programming - O(n^2)<br>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make a tilde before and after O(n^2)

* Binomial Coefficient - O(n) <br><br>

Each of the above 3 implementations have a descending order of time complexities from (1) to (3) <br><br>

For (1) the time complexity is exponential<br>
For (2) the time complexity is O(n^2)<br>
For (3) the time complexity is O(n)<br><br>

The Binomial implementation has the best time complexity while the Recursive implementation has the worst time complexity<br>
In this folder we have the Binomial and Recursive implementations of Catalan Numbers.<br><br>

Expand Down