On 24 July 2011 20:04, vaibhav shukla <[email protected]> wrote:
> generate all possible permutations and check each permutation whether it is
> palindrome or not.


 The time complexity will be high. Instead find the length of the
string . If it is even check the number of occurences
of every character . If a character occurs for an odd number of time
then it will not be a palindrome. Check for even number of
occurences of every character.  If the length of the string is odd .
One character must occur odd number of time .

      So the problem can be solved just by counting

Regards
Sasi kumar T

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to