Rope (computer science)
From Wikipedia, the free encyclopedia
- This article is about the data structure. For other uses, see Rope (disambiguation).
In computer programming, a rope is a heavyweight string, involving the use of a concatenation tree representation. The concept was introduced in a paper called "Ropes: an Alternative to Strings".
A rope is essentially a binary tree whose leaves are character arrays. A node in the tree has a left child and a right child - the left child is the first part of the string, while the right child is the final part of the string. Concatenation of two ropes simply involves the creation of a new tree node with both ropes as children.
[edit] Language Support
SGI's extension to the C++ STL provides a "rope
" class.[1]
[edit] References
- Ropes: an Alternative to Strings (PDF) by Hans-J. Boehm, Russ Atkinson and Michael Plass