mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 06:23:08 +08:00
@ -43,7 +43,8 @@ public class LFUCache<K, V> {
|
||||
* This method returns value present in the cache corresponding to the key passed as parameter
|
||||
*
|
||||
* @param <K> key for which value is to be retrieved
|
||||
* @returns <V> object corresponding to the key passed as parameter, returns null if <K> key is not present in the cache
|
||||
* @returns <V> object corresponding to the key passed as parameter, returns null if <K> key is
|
||||
* not present in the cache
|
||||
*/
|
||||
public V get(K key) {
|
||||
if (this.map.get(key) == null) {
|
||||
|
@ -126,14 +126,10 @@ public class LRUCache<K, V> {
|
||||
private I key;
|
||||
private J value;
|
||||
|
||||
public Entry() {}
|
||||
public Entry() {
|
||||
}
|
||||
|
||||
public Entry(
|
||||
Entry<I, J> preEntry,
|
||||
Entry<I, J> nextEntry,
|
||||
I key,
|
||||
J value
|
||||
) {
|
||||
public Entry(Entry<I, J> preEntry, Entry<I, J> nextEntry, I key, J value) {
|
||||
this.preEntry = preEntry;
|
||||
this.nextEntry = nextEntry;
|
||||
this.key = key;
|
||||
|
@ -124,14 +124,10 @@ public class MRUCache<K, V> {
|
||||
private I key;
|
||||
private J value;
|
||||
|
||||
public Entry() {}
|
||||
public Entry() {
|
||||
}
|
||||
|
||||
public Entry(
|
||||
Entry<I, J> preEntry,
|
||||
Entry<I, J> nextEntry,
|
||||
I key,
|
||||
J value
|
||||
) {
|
||||
public Entry(Entry<I, J> preEntry, Entry<I, J> nextEntry, I key, J value) {
|
||||
this.preEntry = preEntry;
|
||||
this.nextEntry = nextEntry;
|
||||
this.key = key;
|
||||
|
Reference in New Issue
Block a user