Is my understanding correct that both `string` and `Rope` have O(1) appends?

I think `string` has amortized O(1) due to growing buffer space, whereas `Rope` 
has straight-up O(1) runtime complexity.

But what might matter more here is the constant factor, and I think `string` 
ends up doing much fewer allocations than `Rope`, which has to allocate many 
objects on the heap for every iteration.

Rope would get an edge if you needed to do many random inserts/deletes in the 
middle of a very long string.

Reply via email to