Assign a prime number to each of the the characters. Multiply each of the numbers in each string and compare the product. If they are the same then it is a permutation.
Cheers,
Nat
On 4/10/06, Kevin <[EMAIL PROTECTED]> wrote:
But the problem is:
there are much more than 26 possible characters in a string, even ASCII
have 100+ characters I think, not to mention those unicode, those which
use 2 or even more bytes as a character. So the Count[] will be too
large to be practical useful.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---
- [algogeeks] check string A and B isPermutation ? Kevin
- [algogeeks] Re: check string A and B isPermutat... pramod
- [algogeeks] Re: check string A and B isPerm... Kevin
- [algogeeks] Re: check string A and B is... Padmanabhan Natarajan
- [algogeeks] Re: check string A and ... Kevin
- [algogeeks] Re: check string A... Padmanabhan Natarajan
- [algogeeks] Re: check string A and B isPermutat... shishir
- [algogeeks] Re: check string A and B isPermutat... Gene
- [algogeeks] Re: check string A and B isPerm... Kevin
- [algogeeks] Re: check string A and B is... Dhyanesh
- [algogeeks] Re: check string A and ... Padmanabhan Natarajan