Package: extra-collections
Extra-Collections👋extra-collections(orextrafor short) is a python3 pacakge that provides
apythonic,intuitive, andeasyimplementation of the most common
data structures used in software projects. Some of these data structures are
simple such asstackorqueue;
and some are much complicated such asskip_listorred_black_tree.🧐 The name of the pacakge was inspired by thecollectionspython
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.👨🏻‍💻 InstallationTo install the current release (Ubuntu, Windows, Mac):pipinstallextra-collectionsTo update extra-collections to the latest version, add--upgradeflag to the
above commands.🦾 Available Data StructuresIn this release, you can find 2️⃣0️⃣ data structures that can be categorized into
two categories:⚡️ Linear Data Structures:1️⃣Linked List2️⃣Doubly Linked List3️⃣Circular Linked List4️⃣Stack5️⃣Queue6️⃣Deque7️⃣Priority Queue8️⃣Skip List🔥 Non-linear Data Structures:9️⃣Tree1️⃣0️⃣Binary Tree1️⃣1️⃣Binary Search Tree1️⃣2️⃣AVL Tree1️⃣3️⃣Splay Tree1️⃣4️⃣Red-Black Tree1️⃣5️⃣Min Heap1️⃣6️⃣Max Heap1️⃣7️⃣Treap1️⃣8️⃣Trie1️⃣9️⃣Radix Trie2️⃣0️⃣Suffix Trie🚀 Quick tourFirst, you need to enable the python shell:$pythonTo immediately use a data strucutre, you can import it directly from the package
and start using it right-away. The following code uses abst:>>>fromextraimportBST>>>bst=BST([8,5,2,7,15,10,3])>>>bst__8___/\__5_15/\/2710\3>>>bst.insert(30)>>>bst__8___/\__5_15/\/\271030\3>>>bst.remove(3)>>>bst__8___/\__5_15/\/\271030>>>len(bst)7🤝 Contribution guidelinesIf you want to contribute to extra-collections, be sure to review thecontribution_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🚧 Design PrinciplesHere, I will walk you through some of the design principles that I followed
while creating this package:Can't create nested modules.Replace'\n'with'\\n'when seen as an input value.Nonecan't be used as an input value. (Could be changed in future releases).Class constructors can be used for initialization as well as declaration.Methods with no_are for public use. The other are not; unless you know
what you're doing.All public methods must raise appropriate errors when needed. The Other
methods must raise onlyAssertionErrorwhen needed.Search/remove methods shouldn't raise any errors.Insert/delete/get-index/delete-index/set-index methods must raise errors when
needed.All methods should return the data stored not the used objects.Any module can be emptied except for theSuffixTrie.📕 ResourcesThe following are the main resources that helped me while working on this
awesome project:Introduction to Algorithms Course (MIT 6.046J/18.410J)."Data Structures and Algorithms in Python" book.GeeksforGeeksForum.