lcd wrote:

>     Thanks.  Any comment about the red-black trees?  The resulting
> uniq() function should be about as fast as sort(), but having the tree
> operations implemented as macros would make the code a little awkward.
>
>     /lcd

I don't think that uniq should use a red-black tree.
It should only remove consecutive items which
is done in O(n).  If you want to remove all identical
items, call sort() followed by uniq().

There are valid use cases for calling uniq()
on non-sorted array.

> On the other hand, the same trees (or perhaps splays, implemented in
> the same header file) might also be useful for speeding up operations
> involving hash keys.

Balanced tree (red-black tree, splay tree...)
are useful for ordered dictionaries, but not for
hashes. I don't see the link between balanced
trees and hashes.

Regards
Dominique

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui