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!
=== Concat === [[File:Vector Rope concat.svg|right|x200px|thumb|Figure 2.2: Concatenating two child ropes into a single rope.]] : ''Definition:'' <code>Concat(S1, S2)</code>: concatenate two ropes, ''S''<sub>1</sub> and ''S''<sub>2</sub>, into a single rope. : ''Time complexity:'' {{tmath|O(1)}} (or {{tmath|O(\log N)}} time to compute the root weight) A concatenation can be performed simply by creating a new root node with {{mono|1=left = S1}} and {{mono|1=right = S2}}, which is constant time. The weight of the parent node is set to the length of the left child ''S''<sub>1</sub>, which would take {{tmath|O(\log N)}} time, if the tree is balanced. As most rope operations require balanced trees, the tree may need to be re-balanced after concatenation.
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)