Recursion: Given a number, count the number of ways to express a number as sum of powers.
Problem Statement: You are given 2 numbers, x and n. You need to find the number of ways to express x as a sum of nth powers of unique natural…
Recursion: Given a string and a sub-string, count the number of occurrence recursively.
Problem Statement: You are given a string and sub-string. You need to find the occurrence of the sub-string recursively. Example: Input: str1…
Recursion: Print alternate node in a Linked List using recursion
Problem Statement: You are given a LL, you need to print the alternate nodes using recursion Example: Input: 7 -> 6 -> 5 -> 4 -> 3…
Recursion: Print N to 1 using recursion
Problem Statement: You are given an number N, you need to print values from N to 1 using recursion. Example: Input: N = 5 Output: 5 4 3 2 1…
Recursion: Check if a number is palindrome using recursion
Problem Statement: Given an integer “n”, you need to check if the number is palindrome or not. A number when reversed, will…
Recursion: Power of three
Problem Statement: You are given a number, return true if its a power of three else return false. Example: Input: n = 27 Output: true Solution…
Recursion: Given two numbers, add them recursively
Problem Statement: You are given 2 numbers. You need to perform bitwise recursive addition of the 2 integers. Example: Input: a = 20 b = 30…
Recursion: Reverse the queue using recursion
Problem Statement: Reverse the queue using recursion Example: Input: queue = [1, 2, 3, 4] Output: res = [4, 3, 2, 1] Solution Explanation:…
Recursion: Convert a given decimal number into binary using recursion
Problem Statement: You are given a decimal number, you need to convert into binary number using recursion. Example: Input: 15 Output: 1111…