apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sterling Hughes <sterl...@designmultimedia.com>
Subject Re: [PATCH] apr_hash.c -- Make table ordered
Date Thu, 11 Oct 2001 18:37:55 GMT
On Thu, 11 Oct 2001, Branko [ISO-8859-2] Èibej wrote:

> Mladen Turk wrote:
> >OK!
> >I'll propose the two things:
> >1. apr_btree to be able to do the range-based searches
> >
> Sounds useful. (I'd suggest implementing red-black trees, not AVL.)
    why? avl is, too my knowledge, a faster algorithm for all intensive
    purposes (faster insertion, equivalent lookup)..

> >2. apr_shash to be able to sort the hash table.
> >
> Do you mean actually sort elements in the table by some key, or just
> make sure traversal is in the order of insertions? If the first, it's
> probably better to use a tree. If the second, then there should be a way
> to insert an element in a specific place in the traversal.
    a hash is a random access data structure, i don't see any reason
    that in-place insertions and deletions should be allowed, unless of course
    you want to use it in place of a dlist.

    which begs the question, why would you want to use a hash in place of a
    dlist ;)


View raw message