Extra Collections

_images/light-logo.png

👋 “extra-collections” (or “extra” for short) is a python3 pacakge that provides an intuitive, pythonic, easy implementation of the most common data structures used in software projects. Some of these data structures are simple such as Stack or Queue; and some are much complicated such as Skip List or Red-Black Tree.

🧐 The name of the pacakge was inspired by the collections python package which provides simple implementations for some of the basic data structures. “extra” provides an additional set of data structures, hence the name.. “extra-collections”.

🤯 extra-collections, in its first release, provides 20 different data structures each performs different functionality in a very fast and optimized way. Its aim is to make working with these complicated data structres as simple as dealing with a simple linked list which makes things easier to use for everyone espcially if they’re starting their journey into coding.

📒 extra-collections provides API documentations to quickly understand and use those data structures on any given task. At the same time, I did my best to make these python modules as consistent as they could be. So dealing with the most complicated data structrue will as easy as the easiest one.

Fun fact #1:

🤫 extra-collection was originally developed as a way to teach myself how to code and there were no intentions to release it at all. But after spending more than 18 months playing with different data structres, I’ve found out that I’ve implemented 16 different data-structures. Just then, I decided to push it to 20 data structures and release it. Why 20 you ask? Because it is a nice round number 😁.

Fun fact #2:

🤤 The first version of extra-collection was releases on 20/10/2020. I wanted to release it on 20/20/2020 but my brother told me there are only 12 months in a year. I didn’t believe him, but he sweared.

👨🏻‍💻 Installation

To install the current release (Ubuntu, Windows, Mac):

pip install extra-collections

To update extra-collections to the latest version, add --upgrade flag to the above commands.

🦾 Available Data Structures

In this release, you can find 2️⃣0️⃣ data structures that can be categorized into two categories:

⚡️ Linear Data Structures:

🔥 Non-linear Data Structures:

🚀 Quick tour

First, you need to enable the python shell:

$ python

To immediately use a data strucutre, you can import it directly from the package and start using it right-away. The following code uses a Binary Search Tree (BST):

>>> from extra import BST
>>> bst = BST([8, 5, 2, 7, 15, 10, 3])
>>> bst
      __8___
     /      \
  __5       _15
 /   \     /
2     7   10
 \
  3
>>> bst.insert(30)
>>> bst
      __8___
     /      \
  __5       _15
 /   \     /   \
2     7   10    30
 \
  3
>>> bst.remove(3)
>>> bst
      __8___
     /      \
  __5       _15
 /   \     /   \
2     7   10    30
>>> len(bst)
7

🤝 Contribution guidelines

If you want to contribute to extra-collections, be sure to review the contribution_guidelines. By participating, you are expected to uphold this code.

This project uses GitHub issues for tracking requests and bugs, questions and even discussion. Please, if you have any question, direct it to Stack Overflow under extra-collections tag.

_images/stackoverflow-tag.png

📕 Resources

The following are the main resources that helped me while working on this awesome project