Write a recursive function that returns the sum of the digits of a given integer.
PROBLEM:-Write a recursive function that returns the sum of the digits of a given integer.
Here you will get Solutions of DSA Course of Coding Ninjas.
PROBLEM:-Write a recursive function that returns the sum of the digits of a given integer.
PROBLEM:- Check whether a given String S is a palindrome using recursion. Return true or false.
PROBLEM:- Given k, find the geometric sum i.e. 1 + 1/2 + 1/4 + 1/8 + … + 1/(2^k) using recursion.
PROBLEM:-Given an integer N, count and return the number of zeros that are present in the given integer using recursion.
PROBLEM:-Given two integers M & N, calculate and return their multiplication using recursion. You can only use subtraction and addition for your calculation. No other operators are allowed.
OBLEM:-Given an array of length N and an integer x, you need to find all the indexes where x is present in the input array. Save all the indexes in an array (in increasing order).
Do this recursively. Indexing in the array starts from 0.
PROBLEM:- Given an array of length N and an integer x, you need to find and return the last index of integer x present in the array. Return -1 if it is not present in the array.
Last index means – if x is present multiple times in the array, return the index at which x comes last in the array.
You should start traversing your array from 0, not from (N – 1).
Do this recursively. Indexing in the array starts from 0.
-Given an array of length N and an integer x, you need to find and return the first index of integer x present in the array. Return -1 if it is not present in the array.First index means, the index of first occurrence of x in the input array.
Do this recursively. Indexing in the array starts from 0.
PROBLEM:- Given an array of length N and an integer x, you need to find if x is present in the array or not. Return true or false.
PROBLEM:-Given an array of length N, you need to find and return the sum of all elements of the array.