Skip to content

Commit a58ee3f

Browse files
authored
Update LFUCache.h
1 parent 03b07cd commit a58ee3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/LFUCache.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ class LFUCache {
1111
LFUCache(size_t capacity);
1212
int get(int key);
1313
void put(int key, int value);
14+
// Add this line in both LRUCache.h and LFUCache.h
15+
void reset();
1416

1517
// --- New Methods for Stats ---
1618
double getHitRate() const;
@@ -19,8 +21,7 @@ class LFUCache {
1921
private:
2022
void touch(int key);
2123
void evict();
22-
// Add this line in both LRUCache.h and LFUCache.h
23-
void reset();
24+
2425

2526
size_t capacity;
2627
std::unordered_map<int, std::pair<int, int>> cache; // key -> {value, frequency}

0 commit comments

Comments
 (0)