Skip to content

Commit e5528d7

Browse files
committed
Solution to write a Recursion Method to find the factorial of a number
1 parent 44063cf commit e5528d7

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package Resursion;
2+
3+
public class FactorialOfANumber {
4+
public static void main(String[] args) {
5+
6+
}
7+
static int solve(int A) {
8+
if (A == 1) {
9+
return 1;
10+
}
11+
return solve(A-1) * A;
12+
}
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package Resursion;
2+
3+
public class PalindromeString {
4+
public static void main(String[] args) {
5+
6+
}
7+
8+
static void isPalindrome(){
9+
10+
}
11+
}

‎src/Strings/ReverseAString.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@ static String reverseAString(String string){
3030

3131
return new String(characterArray);
3232
}
33+
34+
/*Reverse a String using Resursion*/
35+
36+
static void reverse(){
37+
38+
}
39+
3340
}

0 commit comments

Comments
 (0)