Template binary tree structure in standard library?

M

Michael W. Hicks

Hello,

I'm looking to use a templated binary tree type structure that provides
logorithmic insertion, retrieval and such. I'm familiar with the template<>
class map in the standard library, and while this would work, I've noticed
that map works with pairs consisting of keys and data. I'd prefer to have a
structure that could work directly with keys sans any other field. Does
anyone know of such a structure in the standard library? Is there a way to
modify the map template to use single element records?

Thanks,
Mike
 
A

Artie Gold

Michael said:
Hello,

I'm looking to use a templated binary tree type structure that provides
logorithmic insertion, retrieval and such. I'm familiar with the template<>
class map in the standard library, and while this would work, I've noticed
that map works with pairs consisting of keys and data. I'd prefer to have a
structure that could work directly with keys sans any other field. Does
anyone know of such a structure in the standard library? Is there a way to
modify the map template to use single element records?


Sure sounds like you want std::set to me!

HTH,
--ag
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top