Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!caen!ox.com!jih From: jih@ox.com (John Hritz) Newsgroups: comp.lang.c Subject: Re: Hash??? Not quite clear on what this is... Message-ID: <1990Nov23.213155.21476@ox.com> Date: 23 Nov 90 21:31:55 GMT References: <17291@netcom.UUCP> <1990Nov22.235522.26487@ux1.cso.uiuc.edu> Organization: OTA Limited Partnership Lines: 16 Hashing can also be thought of as an engineering trade-off between space and time. There are far more efficient methods of storing a list of data items, but hashing can have the benifit of yeilding the searched for data faster than the overhead associated with a linear, binary or tree search. The basic balancing point: will it take longer to calculate the hash index and deal with collisions than it will to search by comparisons. Generally, if the list is of moderate size, temporary in lifespan and a hash value can be calculated that doesn't result in a lot of collisions, hashing is a win. Otherwise memory, collisions, or the exoticness of your hash function start to eat into your speed gains. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= John I. Hritz Photons have mass?! jih@ox.com I didn't know they 313-930-9126 were catholic!