data structures - String representations: improvements over ropes? -
I want to make a representation for the string with fast integration and editing functions. I have read the paper, but has there been any significant improvement in this area since 1995?
Edit: A possibility I have first thought that using strings as leaves, but I have a detailed analysis of this; This gives the addition of continuous-time / interruption at intervals (in the number of fragments of the short string), in contrast to the opposite of ropes.
This is an old question! I wonder if someone reads it. But even then it is intraigueing. In your comments, you say that you find it:
Use of fast asymptotics, or static factors, or low memory
OK, the rope O (1) inclusion, and o (n) walking can not do better than you. Substring and indexing is clearly going to be more expensive. But most of the usage cases for large documents do not require editing or random access. If you insert only at the end, then the list of 1D vector / wires can improve the entry time continuously. I used to use it in JavaScript because there was such a slow string contentment
It is said that the representation of memory is less efficient than the strings. I suspect that: If you work in a language that contains garbage collection, then the rope allows you to use the same string fragment frequency in many places. In a rope that represents an HTML document, there will be many DIV
's, SPAN
and LINK
elements. These tags can be automatically assessed to compile the time constants, and you add them directly to the rope, even for such short phrases, the rope document will be greatly reduced in size, the original string In the same sequence of magnitude as in Long-term strings will produce a net profit.
If you read only the elephants of the tree, you can suboprote (express too many phrases as ropes), which occur many times or are shared in rope based stars . The downside of this sharing is that sections of this type of rope can not be changed: to edit or to balance the paste to copy the object graph, but it does not matter that you mostly engage and repeat Are there. In the web server, you can place a subproduction that replaces the CSS stylesheet declaration that is shared across all HTML documents provided by that server.
Comments
Post a Comment