۲۰ تا سوال زیر رو سعی کنید بدون هوش مصنوعی و کمک و فقط با فکر کردن ، به روش recursive حل کنید
🟢 Easy
1. Write a recursive function to calculate the sum of numbers from 1 to n.
2. Write a recursive function to compute the factorial of n.
3. Write a recursive function to print each element of an array.
4. Write a recursive function to count down from n to 1.
5. Write a recursive function to reverse a string.
6. Write a recursive function that returns the length of a string (without using .length).
7. Write a recursive function to check if a number is even.
8. Write a recursive function that prints numbers from 1 up to n.
9. Write a recursive function to count the number of vowels in a string.
10 .Write a recursive function to calculate the power base^exponent.
🟡 Medium
11. Write a recursive function to compute the nth Fibonacci number.
12. Write a recursive function to check if a string is a palindrome.
13. Write a recursive function to sum all elements in a nested array (deep sum).
14. Write a recursive function to flatten a nested array into a single array.
15. Write a recursive function to find the maximum number in an array.
16. Write a recursive function that capitalizes the first letter of each word in an array of strings.
17. Write a recursive function to multiply all numbers in an array.
18. Write a recursive function that removes all occurrences of a given character from a string.
19. Write a recursive function to find the GCD (greatest common divisor) of two numbers.
20. Write a recursive function to merge two sorted arrays into one sorted array (without using loops).
@alithecodeguy #recursive #interview
🟢 Easy
1. Write a recursive function to calculate the sum of numbers from 1 to n.
2. Write a recursive function to compute the factorial of n.
3. Write a recursive function to print each element of an array.
4. Write a recursive function to count down from n to 1.
5. Write a recursive function to reverse a string.
6. Write a recursive function that returns the length of a string (without using .length).
7. Write a recursive function to check if a number is even.
8. Write a recursive function that prints numbers from 1 up to n.
9. Write a recursive function to count the number of vowels in a string.
10 .Write a recursive function to calculate the power base^exponent.
🟡 Medium
11. Write a recursive function to compute the nth Fibonacci number.
12. Write a recursive function to check if a string is a palindrome.
13. Write a recursive function to sum all elements in a nested array (deep sum).
14. Write a recursive function to flatten a nested array into a single array.
15. Write a recursive function to find the maximum number in an array.
16. Write a recursive function that capitalizes the first letter of each word in an array of strings.
17. Write a recursive function to multiply all numbers in an array.
18. Write a recursive function that removes all occurrences of a given character from a string.
19. Write a recursive function to find the GCD (greatest common divisor) of two numbers.
20. Write a recursive function to merge two sorted arrays into one sorted array (without using loops).
@alithecodeguy #recursive #interview