Does Python have a rope data structure?
In writing some Python code, I came upon a need for a string-like data structure that offers fast insertion into, access to, and deletion from arbitrary positions. The first data structure that came to mind was a rope. Does Python have a rope data structure already implemented somewhere? I've looked through the standard library and PyPI, but I haven't seen one. (It doesn't help that there's a refactoring library for Python by the name of Rope as well as a company called Python Rope that sells wire rope.)
There isn't one in the standard library, but there are implementations out there, eg pyropes
.
There's also this list of various non-built-in data structure implementations for Python.
链接地址: http://www.djcxy.com/p/39806.html上一篇: 如何跨数据结构压缩很多字符串?
下一篇: Python是否有绳索数据结构?