HashTable with expirable items
问题 I want to implement a HashTable (or mabybe a HashSet or Dictionary ) which has unique members which expire after a while. For example: // Items expire automatically after 10 seconds (Expiration period = 10 sec) bool result = false; // Starting from second 0 result = MyHashSet.Add("Bob"); // second 0 => true result = MyHashSet.Add("Alice"); // second 5 => true result = MyHashSet.Add("Bob"); // second 8 => false (item already exist) result = MyHashSet.Add("Bob"); // second 12 => true (Bob has