A Rope is a binary tree used to store and manipulate long strings efficiently. It allows for fast concatenation and substring operations.
import { Rope } from "collection-kit";
import { Rope } from "collection-kit";
const rope = new Rope("Hello");
rope.insert(5, " World");
console.log("String:", rope.toString()); // "Hello World"
console.log("Substring:", rope.substring(0, 5)); // "Hello"