If there is a String Buffer, and a String Builder based on array technology, why then is there no equivalent mutable data type based on a Linked List? Or is there?

5 Years
Discussion Span
Last Post by overwraith

The performance of StringBuilder is sufficient for most common purposes. Arrays work quite well when you are mostly appending small strings to the end of a string, and that is a very natural way for strings to be constructed in most applications.

If you want to deal with long strings that support more general editing operations quickly, then you will probably be interested in ropes. You might also want to look a gap buffer which is a more specialized data structure.

Votes + Comments
Ropes & Gap Buffer... very interesting, thanks.

I just created my own class based on this idea, and found that a class based on a linked list is much less efficient in runtime than the built in String Builder, and String Buffer classes. Thanks for the post on ropes and gap buffers, I will look at them.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.