You can use a regular map, but marking each element with a time stamp or “map version number”. If you want to delete items, use two labels. If you can reinsert deleted items, you will need a list of values and label pairs per item.
For example, you search for the key “foo” and you find that it had a value of 5 in versions 0 to 3 (enabled), then it was “deleted”, and then it had a value of -8 in versions 9 to current.
It is of much use to memory and time.
source share