Write this accumuator in a functional style

Rustom Mody rustompmody at gmail.com
Thu Jul 13 08:10:45 EDT 2017


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? 



More information about the Python-list mailing list