How to use easy search on unordered map
Hi I have three field to be stored. For example, Id, name and last name but this three fields are available at different point of time during code execution. First of all, I have all id with me as input and available to me at one go initially. Later on during execution further, I will have id and name together and later on name and last name together. I thought to add unordered map with these three fields as structure and id as key. When I get name and Id , it's easy to find Id in map and append name.... This should be O(1) operation. Now when I get name and last name , it is difficult to search name as it is not key of map.this might be costly as it will not be O(1)... Will it be? Please suggest design decisions on this... Is unordered map right choice ? Feel free to ask for clarification on issue and many thanks in advance for your help.