osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Write this accumuator in a functional style


Marko wrote:
> Simple, yes, but is the worst case 
> insertion/deletion time still within 
> O(log n)? 

Good point; and needs to be applied to Steven's
append-using OP as well

Yeah I know append method is supposedly O(1).
I find that surprising... 
More so when the article
https://wiki.python.org/moin/TimeComplexity
talks of average case Vs amortized-worst case(!) Whatever does that mean?