you its similar kind of problems Already Solve few days back please
check Previous threads. Small Modification needed in previous
solution .except cost not calculated but all possible palindrome have
been generated so hope you can try that & that will help .(Although
its slightly Different Question
if you meant starting the leftmost 1, to check if its palindrome:
unsigned int o = v;
unsigned int r;
for (r = 0; v; v >>= 1)
{
r <<= 1;
r |= v & 1;
}
if (o == r)
printf("palindrome\n");
else
@azhar good solution
Thanks and Regards
Priyaranjan
code-forum.blogspot.com
On Dec 22 2010, 1:55 pm, Azhar Hussain wrote:
> Hi,
>
> Here is the simple solution
>
> unsigned int r = v; // r will be reversed bits of v; first get LSB of v
> int s = sizeof(v) * CHAR_BIT - 1; // extra shif
@ Arif Ali Saiyed
No.s1 = ababa
s2 = abba
in s1 , the longest palidrome is aba , and the total number of substring
which is palindromes is 3
in s2 , the longest palidrome is a, but if we use the longest
palidrome as the substring palidrome , the number will be 3
construct a 2-D array,Arr[strlen][strlen] according to the following rules.
Arr[i][j] = 1 if i = j (they represent string of single char which is
Arr[i], a palindrome by definition)
Arr[i][j] = Invalid if i > j (only half the table across the leading
diagonal would be filled including the diagona
Hi Can you explain following with an example
"esign an
e cient al-gorithm to determine the minimum number of palindromes in
adecomposition for a given string, "
are you asking to find the longest palindrome ?
-Arif
On Nov 16, 11:51 pm, lichenga2404 wrote:
> A palindrome is a string which is iden
@Amir.. in the link i couldn't understand the lengths array used
there..and also..an n-length string has n centres right??, but it was
given that ,,it can have 2n+1 centres..??? can u kindly explain..
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks"