AA implementation algo should be mentioned

Sean Kelly sean at f4.ca
Sat Mar 17 08:41:54 PDT 2007


Davidl at 126.com wrote:
> without looking into phobos or join irc channel people would
> never know what algo is used by AA. and that would make people
> feel AA is not reliable, why not mention the algo used by AA
> and the complexity on the page? i think that would make the
> doc looks better

I personally love the C++ spec in this respect.  Everything in the 
library is treated as an algorithm and complexity information is defined 
for all operations.  However, I'm not sure that specifics about the 
algorithm should be put into the D spec for AAs beyond that they must be 
O(1) for lookups, O(N) for iteration via foreach, and possibly some 
constraints on insert/remove performance (possibly amortized O(1) for 
inserts and maybe O(N) for removals?).


Sean



More information about the Digitalmars-d mailing list