Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Public implementation of ropes in C#?

Tags:

string

c#

ropes

Is there a public implementation of the Rope data structure in C#?

like image 344
luvieere Avatar asked Dec 07 '09 20:12

luvieere


People also ask

What is rope data structure used for?

In computer programming, a rope, or cord, is a data structure composed of smaller strings that is used to efficiently store and manipulate a very long string.

What is cord data structure?

In computing, Chord is a protocol and algorithm for a peer-to-peer distributed hash table. A distributed hash table stores key-value pairs by assigning keys to different computers (known as "nodes"); a node will store the values for all the keys for which it is responsible.

What is rope in c++?

Ropes are scalable string implementation. They are designed for efficient operation that involves the string as a whole. Operations such as assignment, concatenation, and sub-string take time that is nearly independent of the length of the string.


2 Answers

For what its worth, here is an immutable Java implementation. You could probably convert it to C# in less than an hour.

like image 112
Juliet Avatar answered Oct 21 '22 06:10

Juliet


I'm not aware of a Rope implementation (though there probably is one!), but if you're only after doing concatenation, StringBuilder will do the job.

like image 41
Richard Avatar answered Oct 21 '22 06:10

Richard