You are on page 1of 1

1.

Write a recursive function that, given a number n, returns the sum of the
digits of the number n.

2. Write a recursive function that, given a string s, prints the characters of s in


reverse order.

3. Write a recursive function that checks whether a string is a palindrome (a


palindrome is a string that's the same when reads forwards and backwards.)

4. Write a recursive function that, given two strings, returns whether the first
string is a subsequence of the second. For example, given hac and cathartic, you
should return true,but given bat and table, you should return false.

5. Given an array of integers, replace each element of the array with product of
every other element in the array without using division operator.
Example: Input--> {1,2,3,4,5}
Output-->{120,60,40,30,24}

6. For an unsorted array,Find the triplets with given sum in it.


Example: Input--> array=[2,7,4,0,9,5,1,3]
sum=6
Output-->Triplet exists
Below are triplets with given sum 6
(0 1 5),(0 2 4),(1 2 3)

7. Multiply two numbers without using multplication operator(*) or loops

8. Implement Bubble sort using recursion

You might also like