Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Rope (data structure)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Description== A rope is a type of [[binary tree]] where each leaf (end node) holds a string of manageable size and length (also known as a ''weight''), and each node further up the tree holds the sum of the lengths of all the leaves in its left [[subtree]]. A node with two children thus divides the whole string into two parts: the left subtree stores the first part of the string, the right subtree stores the second part of the string, and a node's weight is the length of the first part. For rope operations, the strings stored in nodes are assumed to be constant [[immutable object]]s in the typical nondestructive case, allowing for some [[copy-on-write]] behavior. Leaf nodes are usually implemented as [[string (computer science)|basic fixed-length strings]] with a [[reference counting|reference count]] attached for deallocation when no longer needed, although other [[Garbage collection (computer science)|garbage collection]] methods can be used as well.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)