Skip to content

jutils 0.5.2

Compare
Choose a tag to compare
@JordanWelsman JordanWelsman released this 08 Mar 08:31
· 25 commits to main since this release
2c82aca

Description

This version of jutils comes with a data structure implementation: the Stack.

Changelog

Stack()

jutils defines a queue as a first-in, first-out list of elements. All types supported by Python's intrinsic list object are supported by Queue. Users can use enqueue() to add one or many elements to a queue and dequeue() to remove elements one-by-one. Queues can be combined with other queues with extend() or simply by adding one to another. While there are multiple methods of adding elements to the queue, there is only one method for removing queue elements. There are now new property methods for getting the front and rear elements of the queue. You can do this by using .front and .rear respectively.

Queue()

As previously mentioned, there are now new property methods for getting the top and bottom elements of the stack. You can do this by using .top and .bottom respectively. Queues now support maximum sizes with the capacity argument, and new object properties including .is_empty and .is_full.

Bugfixes

Some bugs were fixed including:

  • A Stack bug which would cause the out-of-order removal of duplicate elements when using .pop()
  • A Stack is_full self.__len__ bug which would cause errors with tests on all dunder methods.