January 09, 2025 |41.0K Views

    Program for Nth Catalan Number (using Binomial Coefficient)

    Description
    Discussion

    Catalan numbers are a sequence of natural numbers that occurs in many interesting counting problems like following.

     

    Count the number of expressions containing n pairs of parentheses which are correctly matched. For n = 3, possible expressions are ((())), ()(()), ()()(), (())(), (()()).


    Count the number of possible Binary Search Trees with n keys (See this)
    Count the number of full binary trees (A rooted binary tree is full if every vertex has either two children or no children) with n+1 leaves.
    Given a number n, return the number of ways you can draw n chords in a circle with 2 x n points such that no 2 chords intersect

     

    Program for Nth Catalan Number (using Binomial Coefficient) : https://www.geeksforgeeks.org/program-nth-catalan-number/