Package: profq-data
ProfQ-DataUsageYou can import the module like any other with:importprofq_dataThen you have access to all kinds ofdata structures.For example, aqueue:fromprofq_sortingimportQueuequeue=Queue()queue.enqueue(1)queue.enqueue(3)print(queue.dequeue())Output: 1There are many more data structures which I have implemented, but here is a few that may interest you:queue,stack,binary treeandlinked list.Data StructuresBinary Treefromprofq_sortingimportBinaryTreeA binary tree is a data structure in which you can input numbers and it will put them at a certain spot. Every node has a right child and a left child, the idea is that every node that is smaller than the parent, will be on the left and every nod that's bigger, on the right. This implementation has no balancing, so it can be quite ineffecient.Hash Tablefromprofq_sortingimportHashTableThis data structure uses a hashing function to determine an index in where it should put an item in an array. If the index is the same, however, it will take the node that is already inside the index and add a reference, basically creating alinked listin that spot.Heapfromprofq_sortingimportHeapA heap is kind of like abinary tree, in that it has a tree-like architecture. It is implemented however with an array. It uses some formulas to see what items are parents and children of each other. Also, it ensures that the minimum element is always on top, and when an item gets added, the tree is always filled left to right.Queuefromprofq_sortingimportQueueQueue is a simple data structure, it's almost identical to an actual queue except it's with data in a computer instead of with people. It works according to FIFO (First In First Out), the acronym says it all really. The items that are added first will exit first, like a queue to see a movie. They don't let the people in the back of the line in first, they let the people on the front in first. The data structure is also very similar to alinked list.Priority Queuefromprofq_sortingimportPriorityQueueA priority queue is the same as aqueue, instead it just has a priority, every item has a priority and items with the highest priority are the first to go out. My implementation lets you have control over what the priority is decided by.Stackfromprofq_sortingimportStackBasically the opposite of aqueue. It uses the principle LIFO (Last In First Out), and again it says it all. You can imagine a "stack" (see what I did there?) of pancakes. You don't take the bottom one (FIFO), you take the top one (LIFO). This one is also based on the linked list.Linked Listfromprofq_sortingimportSinglyLinkedListA the famed linked list, I've talked about it so much because many other data structures use this or the principles of this. It starts with one node, the head, and that node links to another node, that one links to the next and so on and so forth, until you reach the end of the list. This means that, unlike arrays, you can't access every element instantly, you first have to traverse the list. That's a big negative, BUT it can be any length. And maybe Python isn't the greatest programming language to have that in. In other programming languages it can be very easy to make dynamically sized lists.You may have also noticed the class not being calledLinkedListbut insteadSinglyLinkedList. That's because there are many other linked lists including onedoubly linked listand oneskip list.Doubly Linked Listfromprofq_sortingimportDoublyLinkedListA doubly linked list is the same as a singly linked list except that it has another reference, namely the previous node, meaning you can traverse it both ways. This can be extremely helpful for the history of web pages, because you can go forward AND backward, which you can't do with a normal linked list.Skip Listfromprofq_sortingimportSkipListA skip list is the same as a linked list except it has one "express lane" or another linked list. When it wants to insert a node, it uses the express lane to find the node that is before a node that is higher that the one you want to insert and then it traverses the normal linked list. Then it flips a coin to decide whether to add this node to the express lane. Deletion is the same, only it also has to delete the node in the express lane.ConclusionI made this package to learn more about data structures and their uses plus now I can say I've publishedMULTIPLEPython packages (just 2, but still). And I like this way of doing it, because I hope it can help someone who is looking for some implementation of data structures and that they can find this.I used thisplaylistfromHackerRanka lot, it's really helpful!GeeksForGeeksalso has a lot of videos about data structures (and I mean a LOT).It has been really fun learning about all these data structures and I highly encourage you to try and implement some for yourself and see where you can use this in your current/future job!