Complexity nomenclature

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 4 14:57:56 PST 2015


On 12/04/2015 04:40 PM, Timon Gehr wrote:
> Another question is how widely applicable BigO should become beyond
> std.container.

I'm thinking we could add complexity annotations to range functions. For 
example the complexity of map is linear etc.

>E.g. some runtime bounds have multiple parameters.

Yah, I was wondering how necessary that'd be. One problem is how to 
align parameters of different algorithms, for example say one is n * m 
and the other is m log n. What if they swap the order of m and n?

I guess some reasonable convention should take care of this. Otherwise, 
we'll need to use a hashtable mapping names to (exp, logExp) tuples.


Andrei



More information about the Digitalmars-d mailing list