DALPy-Developers / DALPy

A Python package for learning data structures and algorithms.
https://pypi.org/project/dalpy/
MIT License
15 stars 3 forks source link

Addition of a Miscellaneous Utilities Module #1

Closed ChamiLamelas closed 2 years ago

ChamiLamelas commented 2 years ago

Is your feature request related to a problem? Please describe. In some scenarios (e.g. finding a max, initializing graph vertex priorities in Dijkstra's, priority queue insertion) users may want to make use of positive or negative infinity. This also appears in the Cormen textbook. Users may also want to make use of the floor and ceiling mathematical operations.

Describe the solution you'd like I think a new module should be added to the library that includes (positive) infinity as a constant and implementations of the floor and ceiling operations. I believe the module should be named something like utilities or miscellaneous.

Describe alternatives you've considered Currently, when building the starter code for a problem set, the math module is imported or an infinity constant is added in the instance where it is known they would be used. However, to allow users to have these capabilities available in any Cormen Lib code they write, these capabilities should be added to the package. This will provide a better Python implementation of the pseudocode used in the Cormen textbook. I believe these capabilities should be added in a new module in the package as they do not belong in any of the existing modules. I do not believe the new module should be called math because additional functions or constants could be added to it (e.g. functions operating on strings).

Additional context

EitanJoseph commented 2 years ago

Reminder: We should combine this update with a new pypi release homepage that references a repository of select data-structures and algorithms problems and test cases implemented with the Cormen-Lib module.

EitanJoseph commented 2 years ago

Also: We should add links to documentation in the list of supported data structures.

ChamiLamelas commented 2 years ago

Associated pull request approved.