I do not know what data structure to use for this problem. I want the structure to have:
- Insert or delete a time constant.
- Search by constant time by identifier.
Actual system:
I have a bunch of objects with a unique identifier. My program will have to receive requests for an identifier and return the corresponding object.
Whenever he receives a request, I want him to: look for a structure to see if it is there. If so, return it. If this is not the case, load it from the disk into memory (put it in the structure so that the next time it is requested, it does not need to use the disk), and then return it.
I use C.
Here's a similar question , but I'm not sure how appropriate it is.
source
share