Showing posts with label Palindrome [Recursive]. Show all posts
Showing posts with label Palindrome [Recursive]. Show all posts

Wednesday, June 29, 2022

Palindrome [Recursive]

 Palindrome [Recursive]

Problem Statement
Palindrome is a word, phrase, or sequence that reads the same backwards as forwards. Use recursion to check if a given string is palindrome or not.

static boolean check_Palindrome(String str,int s, int e) {
     if (str.length() == 0 || str.length() == 1){
            return true;
        } else {
            if (str.charAt(0) != str.charAt(str.length() - 1)){
                return false;
            } else {
                return check_Palindrome(str.substring(1, str.length()-1),s,e);
            }
        }
    }

ads vert

Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody

  Basic HTML Tables - Layout, HTML Tables, Attributes, Aside, Footer, Tr tag, Td tag, Th tag, Tbody < table >      < thead >    ...