O'Reilly logo

Python Unlocked by Arun Tigeraniya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Third party data structures

Key 3: Using third-party data structures.

Python has a good bunch of data structures in the core language/library. But sometimes, an application has very specific requirements. We can always use third-party data-structure packages. Most of such modules are Python wrapper over C, C++ implementations:

  • The blist module provides a drop-in replacement for list, sortedList, and sortedset. It is discussed in greater detail in later chapters.
  • The bintrees module provides binary, AVL tree, and Red-Black trees.
  • The banyan module provides Red-Black trees, splay tree, and sorted lists.
  • The Sortedcontainers module provides SortedList, SortedDict, and SortedSet. So, one can get almost every data structure for Python easily. More stress ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required