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 

Linked list and queue

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





PostPosted: Mon Aug 30, 2004 5:32 pm    Post subject: Linked list and queue Reply with quote



I would like to ask a question about linked list and queue.
1) Can each node of linked list contain a queue ?
2) Is it the same queue or different queue ?

Back to top
Victor Bazarov
Guest





PostPosted: Mon Aug 30, 2004 6:00 pm    Post subject: Re: Linked list and queue Reply with quote



Kay wrote:
Quote:
I would like to ask a question about linked list and queue.
1) Can each node of linked list contain a queue ?

Yes.

Quote:
2) Is it the same queue or different queue ?

If it's a simple std::list<std::queue>, then it's a different
queue in every list node. If it's std::list<std::queue*>, then
it's a different pointer that might point to the same queue...

Your questions are quite vague. Be more specific next time, OK?

V

Back to top
Karl Heinz Buchegger
Guest





PostPosted: Tue Aug 31, 2004 9:11 am    Post subject: Re: Linked list and queue Reply with quote



Kay wrote:
Quote:

I would like to ask a question about linked list and queue.
1) Can each node of linked list contain a queue ?

Sure. A node of a linked list can contain anything.

Quote:
2) Is it the same queue or different queue ?

Different queues. That is: each node has its own queue

You can arrange for all nodes to share the same queue by
having the queue extern to all nodes and storing pointers
to this queue within the nodes.

So in a nutshell: You are the programmer. You decide how
things should work in your program.

--
Karl Heinz Buchegger
[email]kbuchegg (AT) gascad (DOT) at[/email]

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.