RE: hash
- Posted by Derek Parnell <Derek.Parnell at SYD.RABOBANK.COM> Jun 20, 2002
- 423 views
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C218DE.A065D5F0 charset=iso-8859-2 My recommendation is rather than supply the hashing parameters like this, supply the expected number of elements instead. Other than that, you need to experiment. The speed is dependant on the number of elements and the elements' contents. The sequence of the elements is not relevant. > -----Original Message----- > From: tone.skoda at gmx.net [mailto:tone.skoda at gmx.net] > Sent: Friday, 21 June 2002 14:32 > To: EUforum > Subject: hash > > > > I want to use hash table into which to save some formulas > (strings) to later > (when I get new formula) check > if that formula is already in hash table (was already > evaluated once), data > is discarded. > I'm using hash.e from Derek Parnell. I create table like this: > Got_formulas_ht = Hash_NewTable( {40,40,10,20,20} ) > and I have no idea what this argument should be. If I change > it the speed > doesn't change. > So I'm asking how should that argument look? > Size of table is unknown, grows infinite, I get about 300 > unique formulas > per 30 seconds. > BTW this is strange: if I use sorted sequence and binary > search it it works > with same speed. > > Here are some sample formulas which I save into hash table: > > 4*a > 3*a+b > 3*a+c > 3*a+d > 2*a+2*b > 2*a+b+c > 2*a+b+d > 2*a+2*c > 2*a+c+d > 2*a+2*d > a+3*b > a+2*b+c > a+2*b+d > a+b+2*c > a+b+c+d > a+b+2*d > a+3*c > a+2*c+d > a+c+2*d > a+3*d > ... > pow(b,pow(pow(b,b),a)) > pow(b,pow(pow(b,b),b)) > pow(b,pow(pow(b,b),c)) > ... > (b+2*c)*b > (b+2*c)*c > (b+2*c)*d > a*(b+c+d) > ... > > > > ================================================================== De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================================== The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================================== ------_=_NextPart_000_01C218DE.A065D5F0 Content-Type: application/ms-tnef