This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: avl-trees vs. hashes



I wrote:
>
> I'm working on deletion and downsizing for my hashtables right now.
> Deletion seems to be REAL SLOW, because I basically have to rebuild a
> bucket (basically an alist) every time I remove an entry.

oops.  Nope, I'm modifying the bucket correctly by cdr'ing down to the
entry I don't like and then doing a set-cdr!  (I can't use delete!
directly since I have to check both the hash and the key of the entry).

That's as it should be I think.

The thing that's taking so darn long is that if the current bucket length,
prior to deletion, is equal to the largest bucket size, then I search
through the whole vector trying to find the next largest bucket.  Kind of
wasteful.  Kind of stupid.  I fixed it.


> 	Jay
> 	jglascoe@jay.giss.nasa.gov
> 
> 
>