public static void MyListLastUsedTesting() { Console.WriteLine("======= Remove LastUsed testing ======="); ListLRU <int> list = new ListLRU <int>(); var head = list.Add(100, 1); var second = list.Add(200, 2); list.Add(300, 3); var tail = list.Add(400, 4); Console.WriteLine(list); list.RemoveLastUsed(); Console.WriteLine(list); }
public void RemoveLastUsed() { int key = list.RemoveLastUsed(); dict.Remove(key); }