Another way to use numbers as signatures is by the following function:
sig(S) ::= (no. of "a"/"A"s in S) * 1 + (no. of "b"/"B"s in S) * N + ... + (no.
of "z"/"Z"s in S) * N ^ 25
where N > 2 * B where B is the maximum number of occurrences of the same
character in any one of the input strings. As a quick estimate for B, we could
use the length of the longest string. We can then choose N to be a power of 2
to speed up computing powers of N.
Again, we can rearrange the letters as
sig(S) ::= (no. of "e"/"E"s in S) * 1 + (no. of "t"/"T"s in S) * N + ... etc.
to try to take advantage of the relative frequencies of different letters to
keep the signatures small.
To join two strings together, we now add instead of multiply.
Whether or not this is faster ...
---------------------------------
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your freeaccount today.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group