<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>define palindrome - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/define-palindrome/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/define-palindrome/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Sat, 11 Sep 2021 11:28:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>define palindrome - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/define-palindrome/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to find the Longest Palindrome String in Java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-find-the-longest-palindrome-string-in-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-find-the-longest-palindrome-string-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:33:34 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Craterzone Interview Questions and Answers]]></category>
		<category><![CDATA[define palindrome]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[find longest palindrome in a string dynamic programming]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[longest palindromic substring java]]></category>
		<category><![CDATA[longest palindromic substring o(n)]]></category>
		<category><![CDATA[longest palindromic substring recursion]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[palindrome string program in java]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[print longest palindromic subsequence]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[string palindrome in java]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[what is a palindrome]]></category>
		<category><![CDATA[what's a palindrome]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=643</guid>

					<description><![CDATA[Answer : A palindrome is a word, phrase, number, or other sequence of characters...
]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-find-the-longest-palindrome-string-in-java" class="color-pink" style="text-align: justify;">How to find the Longest Palindrome String in Java ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward, example as madam.</li>
<li>Write a java program to find the longest palindrome present in a given string.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/java/longest-palindrome-%20in-a-string.png" alt=" Longest Palindrome in a String" /></div>
</div>
<p style="text-align: justify;" align="center">Longest Palindrome in a String Using Java</p>
<div class="text-center row" style="text-align: justify;">
<div class="col-sm-12">
<div id="bsa-zone_1590522538159-8_123456"></div>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>The string can be of odd or even length and hence the findLongestPalindromeWithSpecifiedParameter() is called twice for each string.</li>
<li>In the method, findLongestPalindromeWithSpecifiedParameter() left will decrement and move towards the start of the string until it reaches start and then right will increment and move towards the end of the string until it reaches the end.</li>
<li>And any left and right reach destination (i.e. start and end respectively)at any point then the method will return.</li>
</ul>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code" class="color-blue" style="text-align: justify;">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">import java.io.*;<br/><br/><br/>public class LongestPalindromeExample {<br/><br/>    public String findTheLongestPalindrome(String str){<br/>        if (str == null) {<br/>            return null;<br/>        }<br/>        String longestPalindrome = String.valueOf(str.charAt(0));<br/>        for (int i = 0; i &lt; str.length() - 1; i++) {<br/>            String returnedPalindrome = findLongestPalindromeWithSpecifiedParameter(str, i, i);<br/>            if (returnedPalindrome.length() &gt; longestPalindrome.length()) {<br/>                longestPalindrome = returnedPalindrome;<br/>            }<br/>            returnedPalindrome = findLongestPalindromeWithSpecifiedParameter(str, i, i + 1);<br/>            if (returnedPalindrome.length() &gt; longestPalindrome.length()) {<br/>                longestPalindrome = returnedPalindrome;<br/>            }<br/>        }<br/>        return longestPalindrome;<br/>    }<br/><br/>    public String findLongestPalindromeWithSpecifiedParameter(String str, int left, int right) {<br/>        if (left &gt; right)<br/>            return null;<br/><br/>        while (left &gt;= 0 &amp;&amp; right &lt; str.length() &amp;&amp; str.charAt(left) == str.charAt(right)) {<br/>            left--;<br/>            right++;<br/>        }<br/>        return str.substring(left + 1, right);<br/>    }<br/><br/>    public static void main(String[] args){<br/>        LongestPalindromeExample longestPalindrome1 = new LongestPalindromeExample();<br/>        System.out.println(&quot;Longest palindrome in abcmadamcbamadam is &quot; + longestPalindrome1.findTheLongestPalindrome(&quot;abcmadamcbamadam&quot;));<br/>        System.out.println(&quot;Longest palindrome in abcba is &quot; + longestPalindrome1.findTheLongestPalindrome(&quot;abcba&quot;));<br/>    }<br/>}</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-blue">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs bash" data-lang=""><span class="nt">Longest palindrome <span class="hljs-keyword">in</span> abcmadamcbamadam is abcmadamcba
Longest palindrome <span class="hljs-keyword">in</span> abcba is abcba</span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-find-the-longest-palindrome-string-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
