Skip to content

Instantly share code, notes, and snippets.

Avatar

serdarmumcu serdarmumcu

View GitHub Profile
@serdarmumcu
serdarmumcu / RandomCache.java
Created Jul 31, 2020
Random Cache Implementation Java
View RandomCache.java
package com.yazilimmimari.hackerrank;
import java.util.*;
public class RandomCache<S,T> {
HashMap<S,T> cache;
int capacity;
RandomCache(int capacity) {
cache = new HashMap<>(capacity);
this.capacity = capacity;
@serdarmumcu
serdarmumcu / FIFOCache.java
Created Jul 31, 2020
FIFO Cache Java Implementation
View FIFOCache.java
package com.yazilimmimari.hackerrank;
import java.util.LinkedHashMap;
import java.util.Map;
public class FIFOCache<S,T> {
LinkedHashMap<S,T> cache;
int capacity;
FIFOCache(int capacity) {
cache = new LinkedHashMap<>(capacity);
@serdarmumcu
serdarmumcu / LFUCache.java
Created Jul 30, 2020
LFU Cache Implementation Java
View LFUCache.java
package com.yazilimmimari.hackerrank;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
public class LFUCache<S,T> {
public class Node<S,T>
@serdarmumcu
serdarmumcu / LRUCache.java
Created Jul 30, 2020
LRU Cache Java Implementation
View LRUCache.java
package com.yazilimmimari.hackerrank;
import java.util.LinkedHashMap;
import java.util.Map;
public class LRUCache<S,T> {
LinkedHashMap<S,T> cache;
int capacity;
LRUCache(int capacity) {
cache = new LinkedHashMap<>(capacity);
You can’t perform that action at this time.