Is dit jouw bedrijf?
Write the implementation for LRUMap.
Anoniem
LRU stands for Least Recently Used. LRUMap uses the LRU algorithm to delete the least recently used value in the map (presumably full) to make space for the newest entry. Implementation using Java: import java.util.Collections; import java.util.Map; import org.apache.commons.collections.map.LRUMap; public class LRUSample { private static final int MAX_CAPACITY = 5; public static void main(String[] args) { Map lruMap = (Map) Collections.synchronizedMap(new LRUMap(MAX_CAPACITY)); for(int i = 0; i