Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Store Queue in a flat memory space ?

Reply
Thread Tools

Store Queue in a flat memory space ?

 
 
Dhanvi
Guest
Posts: n/a
 
      07-23-2005
Hi,
I have another question for the group.
I would like to know if there is a quick way by which I could store a
Queue in a flat memory space without the use of iterators ?

Thanks
-Dhanvi

 
Reply With Quote
 
 
 
 
Maxim Yegorushkin
Guest
Posts: n/a
 
      07-23-2005
On Sat, 23 Jul 2005 09:47:56 +0400, Dhanvi <(E-Mail Removed)> wrote:

> Hi,
> I have another question for the group.
> I would like to know if there is a quick way by which I could store a
> Queue in a flat memory space


Yes, you can. You can store queue in array or list. The list may be also
be stored in array.

> without the use of iterators ?


Iterators do not impose any restrictions on the data structure they
provide access to, rather contrariwise.

--
Maxim Yegorushkin
<(E-Mail Removed)>
 
Reply With Quote
 
 
 
 
Alan Johnson
Guest
Posts: n/a
 
      07-23-2005
Dhanvi wrote:
> Hi,
> I have another question for the group.
> I would like to know if there is a quick way by which I could store a
> Queue in a flat memory space without the use of iterators ?
>
> Thanks
> -Dhanvi
>


Example :

#include <queue>
#include <vector>

std::queue< int, std::vector<int> > q


By default, deque is used as the underlying sequence for a queue.
However, the standard (as far as I can tell) does not guarantee
contiguous storage for deques (is this what you mean by flat memory space?).

-Alan
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program blocked in Queue.Queue.get and Queue.Queue.put Kris Python 0 01-04-2012 03:46 PM
Is Queue.Queue.queue.clear() thread-safe? Russell Warren Python 4 06-27-2006 03:03 PM
Why Python style guide (PEP-8) says 4 space indents instead of 8 space??? 8 space indents ever ok?? Christian Seberino Python 21 10-27-2003 04:20 PM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-23-2003 07:07 AM
Stack space, global space, heap space Shuo Xiang C Programming 10 07-11-2003 07:30 PM



Advertisments