Most represented string in a TStringlist

Contestcen at aol.com Contestcen at aol.com
Sun Nov 25 06:31:58 CET 2007


Hi Is there an elegant way to determine which string is mostly represented  
in 
a TStringList? For instance if I've got the following the function should  
return 'Delphi': StringList[0] := 'Pascal'; StringList[1] := 'Pascal';  
StringList[2] := 'Delphi'; StringList[3] := 'Delphi'; StringList[4] :=  
'Delphi'; - Wed, Nov 21 2007 1:04 pm 
1 message, 1 author


Probably the fastest way to do this is to hash each item to an  integer and 
then count the occurrences of each hash value.  
 
Frank Rubin




**************************************Check out AOL's list of 2007's hottest 
products.
(http://money.aol.com/special/hot-products-2007?NCID=aoltop00030000000001)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.g-n-u.de/pipermail/gpc/attachments/20071125/b5f26775/attachment.htm>


More information about the Gpc mailing list