Feature: πΈ Enhance + Update + Docs for Memoization #415
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
β Closes: #414
This pull request includes significant updates to the memoization module, with a focus on enhancing performance and code organization. The changes include the removal of redundant files, the introduction of new classes and decorators, and the reorganization of existing code into a more structured format.
Removal of Redundant Files:
Importance-of-memoisation copy.md
,Memoisation.md
,functoolslru_cache_AutomaticMemoization.md
,functoolslru_cache_AutomaticMemoization.py
). [1] [2] [3] [4]Introduction of New Classes and Decorators:
Memoizer
class to handle memoization with logging for cache hits and errors (class_based_memoization.py
).memoize
decorator with logging to replace the use offunctools.lru_cache
(decorator.py
).Reorganization of Existing Code:
factorial
,fibonacci
,knapsack
, andlcs
functions into their respective classes (FactorialCalculator
,FibonacciCalculator
,KnapsackSolver
,LCSSolver
) with memoization applied via the new decorator (factorial.py
,fibonacci.py
,knapsack.py
,lcs.py
). [1] [2] [3] [4]Module Overview and Usage:
Memoisation
module overview with detailed features, including theMemoizer
class and various optimized mathematical functions (Memoization.md
).TESTING