Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: 🎸 Enhance + Update + Docs for Memoization #415

Merged
merged 3 commits into from
Nov 9, 2024

Conversation

yashksaini-coder
Copy link
Contributor

βœ… 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:

  • Removed detailed markdown files explaining memoization and its importance, as well as examples of memoization in various problems (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:

  • Added a Memoizer class to handle memoization with logging for cache hits and errors (class_based_memoization.py).
  • Introduced a memoize decorator with logging to replace the use of functools.lru_cache (decorator.py).

Reorganization of Existing Code:

  • Refactored the factorial, fibonacci, knapsack, and lcs 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:

  • Added a new Memoisation module overview with detailed features, including the Memoizer class and various optimized mathematical functions (Memoization.md).

TESTING

image

Copy link
Contributor

github-actions bot commented Nov 9, 2024

πŸ‘‹ Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!

Feel free to join our community on Discord to discuss more!

@github-actions github-actions bot requested a review from UTSAVS26 November 9, 2024 08:29
@UTSAVS26 UTSAVS26 merged commit 8b3236f into UTSAVS26:main Nov 9, 2024
2 of 6 checks passed
@yashksaini-coder yashksaini-coder deleted the fix-414 branch November 9, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance: Memoization code snippets
2 participants