M
Mike Copeland
I have the following structure defined, and I'm trying to decide the
best container to use for accessing specific elements: "best" meaning
the fastest way. I will be searching on the "sBibNo" field, and it will
likely contain values in a high range (20000-50000). The elements
stored will not be contiguous. I can't allocate an array of elements
because doing so would waste a lot of memory space...so I can't use a
direct index to find the elements.
I'm thinking I could use either an STL list or map for this
application, but I fear the list processing would be prohibitively slow
and the map might be quite wasteful in other ways. The actual number of
elements used in this application probably won't exceed 3000.
Please advise. TIA
struct SHADOWS
{
char sRCode, aRCode;
int sBibNo, aBibNo;
}
best container to use for accessing specific elements: "best" meaning
the fastest way. I will be searching on the "sBibNo" field, and it will
likely contain values in a high range (20000-50000). The elements
stored will not be contiguous. I can't allocate an array of elements
because doing so would waste a lot of memory space...so I can't use a
direct index to find the elements.
I'm thinking I could use either an STL list or map for this
application, but I fear the list processing would be prohibitively slow
and the map might be quite wasteful in other ways. The actual number of
elements used in this application probably won't exceed 3000.
Please advise. TIA
struct SHADOWS
{
char sRCode, aRCode;
int sBibNo, aBibNo;
}