## Count ways to divide circle using N non-intersecting chord | Set-2

Given a number N. The task is to find the number of ways you can draw N chords in a circle with 2*N points such… Read More »

## Total number of possible Binary Search Trees using Catalan Number

Given an integer N, the task is to count the number of possible Binary Search Trees with N keys. Examples: Input: N = 2 Output:… Read More »

## Minimum changes required to make a Catalan Sequence

Given an array arr[] of N integer elements, the task is to change the minimum number of elements of this array such that it contains… Read More »

## Dyck Words of given length

Given an integer n, the task is to count Dyck words possible of length n. A DYCK word is a word containing only characters ‘X’… Read More »

## Number of Permutations such that no Three Terms forms Increasing Subsequence

Given a number N. The task is to find the number of permutations of 1 to N such that no three terms of the permutation… Read More »

## Number of ways a convex polygon of n+2 sides can split into triangles by connecting vertices

Given a convex polygon with n+2 sides. The task is to calculate the number of ways in which triangles can be formed by connecting vertices… Read More »

## Number of Binary Trees for given Preorder Sequence length

Count the number of Binary Tree possible for a given Preorder Sequence length n. Examples: Input : n = 1 Output : 1 Input :… Read More »

## Non-crossing lines to connect points in a circle

Consider a circle with n points on circumference of it where n is even. Count number of ways we can connect these points such that… Read More »

## Dyck path

Consider a n x n grid with indexes of top left corner as (0, 0). Dyck path is a staircase walk from bottom left, i.e.,… Read More »

## Applications of Catalan Numbers

Background : Catalan numbers are defined using below formula: Catalan numbers can also be defined using following recursive formula. The first few Catalan numbers for… Read More »

## Find all possible binary trees with given Inorder Traversal

Given an array that represents Inorder Traversal, find all possible Binary Trees with the given Inorder traversal and print their preorder traversals. Examples: Input: in[]… Read More »

## Succinct Encoding of Binary Tree

A succinct encoding of Binary Tree takes close to minimum possible space. The number of structurally different binary trees on n nodes is n’th Catalan… Read More »

## Construct all possible BSTs for keys 1 to N

In this article, first count of possible BST (Binary Search Trees)s is discussed, then construction of all possible BSTs. How many structurally unique BSTs for… Read More »

## Find the number of valid parentheses expressions of given length

Given a number n find the number of valid parentheses expressions of that length. Examples : Input: 2 Output: 1 There is only possible valid… Read More »

## Program for nth Catalan Number

Catalan numbers are a sequence of natural numbers that occurs in many interesting counting problems like following. 1) Count the number of expressions containing n… Read More »