I was reading about the data structures behind various text editors and had a couple of questions.
If I understand this correctly, searching/traversing on Piece Table is O(n) as you need to go through the linked list one by one, whereas Rope only requires O(logn) time as it is structured as a balanced binary tree.
Then how come in this stackoverflow answer and this IBM article, it claimed that "Insertion become nearly constant time operations" and "in most data-processing routines, sequential access to a rope's characters is what's required, in which case a rope iterator can provide amortized O(1) access speed". Am I missing something here? Shouldn't them all be O(logn) since they need to find the position of the leaf first?
All feedbacks/answers are welcomed! Cheers!