Yes, a map sounds perfect for this. So, what was the question about a
linked list? Just use a map.
thanks
i'm using tree not exactly link link.
suppose i create a window explorer type application which shows folders
in tree hierarchy and files under folder.
For folders i'm using tree. I'll use API functions to find folder/file.
So i need to allocate memory at run time. For each folder there may be
many files. For each Folder memory will alocated only once but for files
i need to allocate for each. If duplicate file then i need to search. To
avoid search i thought to use map.
All STL containers (and a lot of non-STL ones) would allow you to
insert unique values.
Please tell me some name.
Scot T Brennecke" <ScotB@Spamhater.MVPs.org> wrote in message
news:e1BdN%23UOKHA.4336@TK2MSFTNGP06.phx.gbl...
ashish wrote:
std::map allows to insert unique values(key), is there any other data
tyep which allows same.
can u use map in a link list, when allocate memory to link list i can
insert some values in map
I think you are asking for a linear container that enforces uniqueness
of inserted elements. However, is there a reason why you cannot just
use a map instead of a list? You can iterate a map.