Re: Complexity guaranties of array append operator

2014-11-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/5/14 10:48 PM, Dmitriy wrote: Hello, I'm in the middle of learning D. I can't find any definitive information about what is the complexity of operator ~= when used for adding an element to an array. Is it amortized O(1) or is it implementation defined? (I hope it at worst O(n) though I have

Re: Complexity guaranties of array append operator

2014-11-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, November 06, 2014 03:48:26 Dmitriy via Digitalmars-d-learn wrote: > Hello, I'm in the middle of learning D. I can't find any > definitive information about what is the complexity of operator > ~= when used for adding an element to an array. Is it amortized > O(1) or is it implementatio

Complexity guaranties of array append operator

2014-11-05 Thread Dmitriy via Digitalmars-d-learn
Hello, I'm in the middle of learning D. I can't find any definitive information about what is the complexity of operator ~= when used for adding an element to an array. Is it amortized O(1) or is it implementation defined? (I hope it at worst O(n) though I haven't seen any information about tha