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
Adaptive Replacement Cache (ARC) #5116
base: master
Are you sure you want to change the base?
Conversation
Have you read the CONTRIBUTING.md correctly? It would help if you wrote parametrized tests in a separate file in the |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5116 +/- ##
============================================
+ Coverage 38.16% 38.24% +0.07%
- Complexity 2362 2370 +8
============================================
Files 517 518 +1
Lines 15350 15400 +50
Branches 2965 2971 +6
============================================
+ Hits 5858 5889 +31
- Misses 9205 9220 +15
- Partials 287 291 +4 ☔ View full report in Codecov by Sentry. |
src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java
Outdated
Show resolved
Hide resolved
src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java
Outdated
Show resolved
Hide resolved
src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java
Outdated
Show resolved
Hide resolved
src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java
Outdated
Show resolved
Hide resolved
Please ensure that tests are added to handle lines with partial coverage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed and update the code
You should format the code. LGTM |
It aims to provide better performance compared to traditional caching algorithms like LRU (Least Recently Used) and LFU (Least Frequently Used).
Main Method Removed for ARCCache.java
Test cases added for the ARC
….java Co-authored-by: SOZEL <[email protected]>
….java Co-authored-by: SOZEL <[email protected]>
….java Co-authored-by: SOZEL <[email protected]>
….java Co-authored-by: SOZEL <[email protected]>
Replaced private final p(Pivot) using private final int t1Capacity; private final int b1Capacity; adjustCacheSize();
updated test case for t1capacity and b1 capacity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated comments
Please format your code using |
src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java
Outdated
Show resolved
Hide resolved
src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java
Outdated
Show resolved
Hide resolved
Updated capacity method
Updated capacity method to handle negative input
Please add the missing tests and update your branch. |
clang-format -i --style=file path/to/your/file.java