Java icon indicating copy to clipboard operation
Java copied to clipboard

LFUCache unexpected result

Open supertonyliu opened this issue 2 years ago • 2 comments

Description

https://github.com/TheAlgorithms/Java/blob/master/src/main/java/com/thealgorithms/datastructures/caches/LFUCache.java function: private void addNodeWithUpdatedFrequency(Node node) line 104 I think 104 code line:
node.previous = temp.previous;
need change: temp.previous = node;

Steps to reproduce

No response

Excepted behavior

result ok!

Screenshots

No response

Additional context

No response

supertonyliu avatar Dec 01 '22 09:12 supertonyliu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jan 01 '23 00:01 github-actions[bot]

Thanks for reporting, could you create a PR with the proposed change?

siriak avatar Jan 01 '23 20:01 siriak

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 01 '23 00:02 github-actions[bot]

Fixed

siriak avatar Feb 02 '23 07:02 siriak