Thomas,

Not wanting to be a pedant, but you're mixing up Hashing (hash tables) 
and B-trees.  B-Trees have O(log n) lookup time as you say, but 
hashing/hash tables/hash maps don't use B-Trees and in fact has O(1) 
lookup time.  It takes just as long (in general case) to look up an item 
from 100 as it does from 100 000 000.  See for example the entry on 
wikipedia for "Hash table".

The thought also crossed my mind that Dave could probably load up his 
entire database into memory and do all his operations using his own 
datastructures and algorithms (e.g. hash tables) and probably see all 
his problems disappear dramatically (especially since it's a single user 
application on a single PC) but of course this may (probably would) 
require major rework and so is probably unfortunately likely not going 
to happen... (Also, with the amount of growth per week, such a solution 
may not be scalable so is possibly not such a good idea from that point 
of view either...  Dave, by how much does the database grow in size 
terms on a weekly basis, after compacting?)

Anyway, best regards,

Walter Prins

Thomas Hruska wrote:

>An associative hash is not the same thing as a cryptographic hash.  An 
>associative hash is a data structure that implements a B-tree and thus 
>has O(log n) insert and search times.  I've found them to be 
>resource-friendly and very high-performance (partly why they are used to 
>implement database indexes).
>
>Look up "stl map" on Google.  I know it isn't Delphi, but that's the 
>data structure I'm referring to (and there are examples of how to use 
>stl map).  Apparently JEDI has 'JclStrHashMap' which supposedly 
>implements a string-based associative hash (but I didn't see any example 
>code using it, but it should be similar to stl map).  The following page 
>showed up when running a Google search for "JclStrHashMap":
>
>http://www.koders.com/delphi/fid02907AFF1132DABC5F684C899D2D01D7D72FEBEC.aspx
>
>  
>


-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to