Implementation of Rope data structure