Given two integers M and X, the task is to find the number of sequences of length M that can be generated comprising X and… Read More

# Tag Archives: catalan

Given an array, arr[] consisting of N distinct elements, the task is to count possible permutations of the given array that can be generated which… Read More

Given an integer N, the task is to find the number of distinct bracket sequences that can be formed using 2 * N brackets such… Read More

Given an integer N which denotes the size of a matrix, the task is to find the number of possible ways to reach the bottom-right… Read More

Given an integer N, the task is to find the number of possible binary strings of length N with an equal frequency of 0‘s and… Read More

Competitive Programming (CP) doesn’t typically require to know high-level calculus or some rocket science. But there are some concepts and tricks which are sufficient most… Read More

Prerequisite: Total number of possible Binary Search Trees with n keys Given an array arr[] of N integers. The task is to count the number of… Read More

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

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

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

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

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

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

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

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