String representations: rope improvements?

I need a view for strings with fast concatenation and editing operations. I read the article "Ropes: an alternative to strings" , but have there been any significant improvements in this area since 1995?

EDIT: One of the possibilities I examined earlier uses 2-3 fingers of a tree with rows in the form of leaves, but I have not done a detailed analysis of this yet; this gives a depreciable addition / deletion of the time constant at the ends and logarithmic (in the number of pieces of a smaller string) concatenation, as opposed to the other way around for ropes.

+5
source share
1 answer

This is an old question! I wonder if anyone is reading this. But still it is intriguing. In your comments, you say you are looking for:

Faster asymptotics or constant factors or less memory usage

Well, ropes have an O (1) insert and an O (n) iteration. You cannot do better. Substrings and indexing will obviously be more expensive. But most use cases for large documents do not require editing or random access. If you only concatenate at the end, a 1D vector / row list can improve the insertion time constant. I used this in JavaScript because it had such a slow string concatenation.

, , . , : , . , HTML-, DIV, SPAN LINK. , , , . , . .

elemenst , ( , ), . , : , . , . - , CSS, HTML-, .

+1

All Articles