java program to check palindrome number using recursion

Solutions on MaxInterview for java program to check palindrome number using recursion by the best coders in the world

showing results for - "java program to check palindrome number using recursion"
Stefania
15 Jul 2017
1import java.util.Scanner;
2public class RecursivePalindromeJava 
3{
4   // to check if string is palindrome using recursion
5   public static boolean checkPalindrome(String str)
6   {
7      if(str.length() == 0 || str.length() == 1)
8         return true; 
9      if(str.charAt(0) == str.charAt(str.length() - 1))
10         return checkPalindrome(str.substring(1, str.length() - 1));
11      return false;
12   }
13   public static void main(String[]args)
14   {
15      Scanner sc = new Scanner(System.in);
16      System.out.println("Please enter a string : ");
17      String strInput = sc.nextLine();
18      if(checkPalindrome(strInput))
19      {
20         System.out.println(strInput + " is palindrome");
21      }
22      else
23      {
24         System.out.println(strInput + " not a palindrome");
25      }
26      sc.close();
27   }
28}
Yannick
07 Jan 2019
1// Java program to check palindrome number using recursion
2public class PalindromeNumberRecursion
3{
4   static int palindromeRecursion(int number, int temp)
5   {
6      if(number == 0)
7         return temp;
8      // storing reverse of a number
9      temp = (temp * 10) + (number % 10);
10      return palindromeRecursion(number / 10, temp);
11   }
12   public static void main(String[] args)
13   {
14      int number = 141;
15      int temp = palindromeRecursion(number, 0);
16      if(temp == number)
17      {
18         System.out.println("number is palindrome.");
19      }
20      else
21      {
22         System.out.println("number is not palindrome.");
23      }
24   }
25}
queries leading to this page
java program makes palindrome number using recursionrecursive palindrome function javafind palindrome in string javapalindrome string program in javajava program to check palindrome string using recursionhow to find next palindrome string in javajava program to check string is palindrome or notjava program to find palindrome numbercheck if a string is a palindrome javajava find palindrome in string2 strings are palindrome or not in javacheck string palindrome algorithm javajava palindrome recursionis palindrome java recursivechecking palindrome string in javacheck if number is a palindrome java recursivepalindrome using recursion javacheck if character array is palindrome java using recursiongiven string is palindrome recursionprogram to find palindrome string in javafind the palindrome in a string javacheck if a number is palindrome using recursion javahow to get palindrome of a number in javacheck if string is palindrome java iterative and a recursive solutionpalindrome substring in javahow to check if number is palindrome in javacheck is a string is a palindrome javaread a number and check for palindrome in javastring palindrome in recursivepalindrome program in java using recursioncheck if a given string is palindrome using recursion in javapalindrome using recursion in javacheck if string is palindrome using recursion in javaprogram for palindrome pattern printing in javanumber of palindrome string in javapalindrome recursion java codepalindrome through recursion javafind count of palindromes in a string in javacheck the string is palindrome or not in javapalindrome string in java using stackto print all palindrome number in javacheck palindrome recursion javapalindrome string in java using recursionpalindrome recursive in javahow to search for palindrome in array of strings in javarecursive method for palindrome javahow to find number is palindrome in javacheck for palindrome recursionjava program to check palindrome number using recursioncheck if a string is a palindrome using a stack javafactorial of 1check palindrome recursion javahow to traverse a palindrome java using a string methodprogram to find a number is palindrome or not in javapalindrome string program in java using recursioncheck if a string is a palindrome recursivefind palindrome string in javahow to traverse a palindrome java using substring methodmethod to check if input string is palindrome in javahow to see if a string is palindrome or not in java programfind palindrome in a string using regex in javacheck if string is a palindrome java recursiveidentify palindrome string using stack in javafind palindrome substring in string in javanumber palindrome program in javawrite a java program using recursion to check if an input of 5 digits is a palindrome or not palindrome java progrea recursionpalindrome string in javaispalindrome recursive javabuild a palindrome from given string in javaprogram for palindrome in javado palindrome string in javastring palindrome using recursion in javajava method to check palindromerecursive palindrome testerpalindrome in java recurssivecheck palindrome of string in javapalindrome program using recursion in javajava program to check whether string is palindrome using library methodscheck for palindrome string in javaallintitle 3ajava program to check palindrome number using recursionjava string palindromeall substrings palindrome javajava program to check whether string is palindromefind longest palindrome substring in javastring palindrome using recursion javahow to do a palindrome method in javafind all possible palindromes in a string in javapalindrome recursion javapalidrome string in javahow to print a palindrome in javastring palindrome program in javajava program for palindrome number using recursionjava program to check palindrome stringcheck if a string is palindrome in javahow to make a string palindrome in javacheck string is palindrome or not in java using recursionchecking if a string is a palindrome javacode to return a palindrome string in javawrite a string palindrome program in java java program to check if string is palindromepalindrome java recursionpalindrome recursion reversepalindrome with normized string in javahow to check if a string is a palindrome in java using recursionjava method to check if a string is a palindromehow to check palindrome string in javaprogram to check that the string is palindrome in javareturn all palindromes in a stringhow to check if string is palindrome in java using recursionhow to check if string is palindrome javarecursion palindrome javajava program to check the string is palindrome or notfind all palindromes in a string javastring palindrome in java using functionpalindrome string complex java programpalindrome string algorithm javahow to find a string is palindrome or not in javastring palindrome in javajava recursion for palindromestring is a palindrome or not in javahow to find palindrome string in javajava program for a recursive function which checks the string is palindrome or notsimple java recursion program for palindrome numberpalindrome number recursion javasubstring palindrom java recurisvepalindrome string function in javapalindromecutting 28s 29 in javapalindrome program in java whether string or numberhow to check if a string is palindrome in javahow to find next palindrome stringin javajava palindrome program using recursionpalindrome of a string in javawrite a program to check number is palindrome or not javaalgorithm to find palindrome in a stringcheck palindrome string javawrite a program to check palindrome string in javapalindrome recursive solution javacheck palindrome string in javapalindrome recursive function javapalindrome recursive java complexitycheck if string is palindrome recursivelydetect palindrome in javais palindrome number possible program in javachecking string palindrome in javajava string palindrome programrecursive palindrome javahow to find whether a string is palindrome or not javahow to check palindrome string in java 3fcheck palindrome recursive javastring palindrome javapalindrome in java recursivejava palindrome stringpalindrome in java using recursionpalindrome in string javajava program given string is palindrome or notpalindrome program in javacheck a string is palindrome or not in javapalindrome recursionpalindrome number using recursion javarecursive java method to check palindromepalindrome using recursionmake a string palindrome in javajava is string palindromeprogram to check palindrome in javapalindrome string logic in javafind palindromes in javacheck palindrome using stack in javacheck if a given string is palindrome using recursionrecursive java function determining if a palindromejava program to check palindromepalindrome string using recursion javausing a boolean method to find a palindrome in a recursion javapalindrome with recursion in javastring palindrome in java using for looppalindrome string in javapalindrome recursion test javahow to check for palindrome in javajava get total palindrome in stringalgorithm for string palindrome in javapalindrome string using recursion in javapalindrome check recursion javacheck if a given string is palindrome using recursion in javawrite a recursive program to check if a string is a palindrome 3f the method returns a boolean to indicate if the string is a palindrome or not 5b4 pts 5dwhat is the time complexity of your algorithm 3f 5b2 pts 5dcheck palindrome in java using recursionjava palindrome algorithmpalindrome recursive javais palindrome string javahow to check given number is palindrome or not in javahow to find number of palindromes in a string javajava palindrome using recursionhow to chekc the string to palindrom in java recursivestring palindrome in java using recursionjava program to make palindrome number using recursionfunction to check given string string is palindrome or not in javajava program to print palindromehow find the palindrome of the string recursive in javahow to find a palindrome in javajava check if string is palindromefind if given string is palindrome in javacheck if a given string is palindrome using recursion in java using stringbuildercheck string palindrome in javapalindrome code substring javapalindrome java program stringsimple java program for palindrome numberdo palindrome string in java programpalindrome checker using recursion in javajava program to check palindrome number using recursion