4 ms·
Should probably be a good idea to move from String to Ropes. http://scienceblogs.com/goodmath/2009/01/ropes_twining_together_strings.php http://scienceblogs.com
by krishna2 17y ago
Should probably be a good idea to move from String to Ropes.
http://scienceblogs.com/goodmath/2009/01/ropes_twining_together_strings.php http://scienceblogs.com/goodmath/2009/01/ropes_twining_toget...
A short snippet: What works extremely well is to take the basic idea of a list of mini-buffers (that is, smallish character arrays), and tweaking it, so that instead of keeping a list of sub-buffers, you put the sub-buffers into a binary tree. The result is a structure called a rope. To the best of my knowledge, ropes were invented by Hans Boehm (of garbage collection fame). Ropes are a simple, elegant data structure that's excellent for representing large string-like data structures. (The name is a pun: a real-world rope is made by twining together lots of smaller strings. A data-structure rope tangles together data-structure strings.)