C# Expand Dictionary or Hashtable to include Pop and Push (LIFO)
Looking for structure that contains the benefits of a stack but the ability to only contain one item that matches a key. For example Data comes in from various clients, I am only interested in the last piece of data from a particular client. So a dictionary would work very well. However I want to process the data from all the clients in a LIFO scenario, so a stack would be best. Any ideas on combining the two? There are several ways to interpret what you want. For instance when you Push a value with a key which already exists, what happens? Existing item is popped, new one pushed, Replace