Re: Suggestions for double-hashing scheme



Clint Olsen <clint@xxxxxxxxx> writes:

> On 2005-06-12, Tim Rentsch <txr@xxxxxxxxxxxxxxxxxxx> wrote:
> > The algorithm doesn't need recursion or a stack; just plain iteration
> > can work. Here's an example, assuming pointers are the values being
> > saved -- a null pointer with a probe count of zero is an EMPTY slot, a
> > null pointer with a probe count greater than zero is a DELETED slot.
>
> Ahh, ok, so you're using the copy-out method as I described as one of my
> workarounds. If we wanted to do an in-place move in the hash, then it's
> more work as I described. I wasn't planning on using references (void
> pointers) since I would like to have arbitrary-sized objects occupying the
> hash. It's the way I designed my array library, so I wanted to be as
> consistent as possible.

Sorry for not responding to this earlier.

The items that are being moved are the items in the hash table
itself, which are of fixed size (they are in an array, after all).
If you want to hash variable-sized data, they need to be stored
separately in any case. The hash table array would store, eg,
a pointer to the memory holding the element being hashed.

Make sense?

.



Relevant Pages

  • Re: symtab
    ... So if the hash is 2/3 filled, ... So, for a binary tree we need two pointers ... With doubling for resizing, that would mean that just before ...
    (comp.lang.forth)
  • Re: transport a C pointer through Tcl
    ... Andreas Otto wrote: ... I've taken a different approach lately with extension pointers. ... In other words I store an int offset in each Tcl_Obj, ... It's also faster than Tcl's hash table, ...
    (comp.lang.tcl)
  • Re: Suggestions for double-hashing scheme
    ... > The items that are being moved are the items in the hash table itself, ... The hash table array would store, eg, a pointer to the memory ... on allocating enough space to store data elements of any size. ... Additionally storing pointers to them would make me incur the charge twice. ...
    (comp.programming)
  • Re: Setting up email on my FC1
    ... Hash: SHA1 ... > know of any pointers to getting started? ... Automatic actions for USB cameras, cardreaders, memory sticks, MP3 players ...
    (Fedora)
  • Re: Differance between Array and Pointers
    ... Well, except that arrays tend to be much larger than pointers, and the ... An array is a contiguous region of memory containing N elements of M ... indexing vs. a loop). ...
    (comp.arch.embedded)