What is best data structure suitable to implement editor like notepad?

后端 未结 6 771
抹茶落季
抹茶落季 2021-01-31 12:15

Which data structure/s is used in implementation of editors like notepad. This data structure should be extensible, and should support various features like edition, deletion, s

6条回答
  •  南笙
    南笙 (楼主)
    2021-01-31 12:46

    Check out Ropes. Handles fast insert/delete/edit of strings. Ranges are usually supported in Rope implementations, and scrolling can be done with an inverted index into the rope.

提交回复
热议问题