Skip to content

Category Archives: Recursion

Given an array A[]. The task is to count the number of subsequences such that concatenation of binary representation of the numbers represents palindrome. Examples:… Read More
Given an array Arr[] of size N and an integer K, the task is to find the length of the shortest subsequence having sum exactly… Read More
Given two arrays a[] and b[] and an integer K, the task is to find the length of the longest common subsequence such that sum… Read More
Given two numbers N and K, the task is to find all valid combinations of at most K numbers that sum up to N such… Read More
Given two numbers N and K, the task is to find the count of all valid combinations of at most K numbers that sum up… Read More
Given two strings s1 and s2, the task is to find the length of the longest common subsequence with no repeating character. Examples: Input: s1=… Read More
Given an array arr[] of size N that contains the differences between the adjacents elements of an array. The task is to generate all possible… Read More
Given two numbers N and r, find the value of NCr using recursion Examples: Input: N = 5, r = 2Output: 10Explanation: The value of… Read More
Given a binary tree, the task is to find the length of the longest path which forms an Arithmetic progression. The path can start and… Read More
Given an array arr[], the task is to find the number of rotations required to convert the given array to sorted form.Examples: Input: arr[] =… Read More
Given an array arr[], the task is to find the number of rotations required to convert the given array to sorted form.Examples: Input: arr[] =… Read More
Given an array arr[], the task is to find the number of rotations required to convert the given array to sorted form.Examples: Input: arr[] =… Read More
Given an array arr[], the task is to find the number of rotations required to convert the given array to sorted form.Examples: Input: arr[] =… Read More
Given a Binary Tree rooted at root, the task is to find the sum of all leaf nodes which are left child of their parents… Read More
Given two integers N and K, the task is to print the first K bits of the Nth term of the Thue-Morse sequence. The Thue-Morse… Read More

Start Your Coding Journey Now!