Balanced trees
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Mon Mar 10 21:26:27 EDT 2014
On Mon, 10 Mar 2014 19:24:07 -0400, Roy Smith wrote:
> In article <8761nmrnfk.fsf at elektro.pacujo.net>,
> Marko Rauhamaa <marko at pacujo.net> wrote:
>
>> Anyway, this whole debate is rather unnecessary since every developer
>> is supposed to have both weapons in their arsenal.
>
> The problem with having a choice is that it opens up the possibility of
> making the wrong one :-)
>
> As this discussion has shown, figuring out whether a hash table or a
> tree is better for a given problem is non-trivial. My guess is that if
> you gave 1000 typical developers both data structures and let them pick
> freely, the number of cases where it really mattered and the developer
> picked the right one would be approximately equal to the number of cases
> where they picked the wrong one.
You're very optimistic.
In my experience, the average developer has an amazing talent for
pessimising code when they think they are optimising it.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
More information about the Python-list
mailing list