C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

queue where I can delete in the middle?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Gernot Frisch
Guest





PostPosted: Thu Dec 30, 2004 7:29 am    Post subject: queue where I can delete in the middle? Reply with quote



Hi,


which container class can I use that has push/pop at front/back and
allows me to remove any object in the queue?

--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}

________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com


Back to top
velthuijsen@hotmail.com
Guest





PostPosted: Thu Dec 30, 2004 8:06 am    Post subject: Re: queue where I can delete in the middle? Reply with quote



deque and list.

Depending on which operation you are going to perform the most on the
container you have to chose between those two
If you expect a lot of insertions/deletions not on the ends a list is
more interesting.
If you expect only an occasional insert/delete not at the ends go for
the deque.

Back to top
Mole Wang
Guest





PostPosted: Thu Dec 30, 2004 10:52 am    Post subject: Re: queue where I can delete in the middle? Reply with quote



vector, list, deque...
I think any container can do.
"Gernot Frisch" <Me (AT) Privacy (DOT) net> wrote

Quote:
Hi,


which container class can I use that has push/pop at front/back and
allows me to remove any object in the queue?

--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}

________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com





Back to top
Jonathan Mcdougall
Guest





PostPosted: Thu Dec 30, 2004 5:15 pm    Post subject: Re: queue where I can delete in the middle? Reply with quote

Mole Wang wrote:
Quote:
"Gernot Frisch" <Me (AT) Privacy (DOT) net> wrote



which container class can I use that has push/pop at front/back and
allows me to remove any object in the queue?

Don't top-post. Rearranged.

Quote:
vector, list, deque...
I think any container can do.

No. Only sequential containers (vector, list,
deque and adapters stack, queue and priority
queue) can push and pop and some of them have
restrictions over front and back. For example,
vector has no push_front() function.

Only deque and list can push and pop at the end
and beginning while allowing "random" insert and
erase.

Jonathan

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.