473,387 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Queue or the sorts

I am trying to create a 'queue', or something like it. I am storing 1 to 6
integers in a list and need to move backwards and forwards in the list
(like the back and forward arrows do in internet explorer, except these are
numbers). I have tried a Stack, queue class, but can't seem to make them
work right moving back forwards / backwards. This list of numbers will
start with no numbers in it and grow to a max of 6 numbers, depending on how
many numbers are added to it.
Thanks a bunch
BUC
Mar 6 '07 #1
4 1108
On Mar 6, 2:07 pm, <bucrepuswrote:
I am trying to create a 'queue', or something like it. I am storing 1 to 6
integers in a list and need to move backwards and forwards in the list
(like the back and forward arrows do in internet explorer, except these are
numbers). I have tried a Stack, queue class, but can't seem to make them
work right moving back forwards / backwards. This list of numbers will
start with no numbers in it and grow to a max of 6 numbers, depending on how
many numbers are added to it.
Thanks a bunch
BUC
I would use a List(Of T) I think. You really need random access for
this, and queues and stacks aren't really designed for this.

--
Tom Shelton

Mar 6 '07 #2
Hi,

A queue and a stack are not made for what you ask, I don't know if you have
ever been to England because that is the best place learning what is a
queue.

If you go to a shop you nicely go to the end of the queue, wait until you
are at the end and do your shoping. Maybe you find this normal, however in
England it is real exactly done like this.

A stack is how your program is working.

You have the Main Stack A, that calls another stack B, that calls another
stack C, which is the same as the previous the B. The A is done, the B is
done, the C is done, the B ends, the C ends, the B ends, the A ends. (In
this is a part of recursion)

I hope this gives an idea

Therefore I have the same idea as Tom and use his advice.

Cor
<bucrepusschreef in bericht news:%2***************@TK2MSFTNGP02.phx.gbl...
>I am trying to create a 'queue', or something like it. I am storing 1 to 6
integers in a list and need to move backwards and forwards in the list
(like the back and forward arrows do in internet explorer, except these are
numbers). I have tried a Stack, queue class, but can't seem to make them
work right moving back forwards / backwards. This list of numbers will
start with no numbers in it and grow to a max of 6 numbers, depending on
how many numbers are added to it.
Thanks a bunch
BUC

Mar 7 '07 #3
Cor,
That's a nice analogy. To put it more briefly, queues are used for
first-in-first-out, and stacks are used for first-in-last-out.
Robin S.
--------------------------------
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:O2****************@TK2MSFTNGP05.phx.gbl...
Hi,

A queue and a stack are not made for what you ask, I don't know if you
have ever been to England because that is the best place learning what is
a queue.

If you go to a shop you nicely go to the end of the queue, wait until you
are at the end and do your shoping. Maybe you find this normal, however
in England it is real exactly done like this.

A stack is how your program is working.

You have the Main Stack A, that calls another stack B, that calls another
stack C, which is the same as the previous the B. The A is done, the B is
done, the C is done, the B ends, the C ends, the B ends, the A ends. (In
this is a part of recursion)

I hope this gives an idea

Therefore I have the same idea as Tom and use his advice.

Cor
<bucrepusschreef in bericht
news:%2***************@TK2MSFTNGP02.phx.gbl...
>>I am trying to create a 'queue', or something like it. I am storing 1 to
6 integers in a list and need to move backwards and forwards in the list
(like the back and forward arrows do in internet explorer, except these
are numbers). I have tried a Stack, queue class, but can't seem to make
them work right moving back forwards / backwards. This list of numbers
will start with no numbers in it and grow to a max of 6 numbers,
depending on how many numbers are added to it.
Thanks a bunch
BUC


Mar 7 '07 #4
WTF is england?

I thought that they are now a state in the US or something


On Mar 6, 10:18 pm, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Cor,
That's a nice analogy. To put it more briefly, queues are used for
first-in-first-out, and stacks are used for first-in-last-out.
Robin S.
--------------------------------
"Cor Ligthert [MVP]" <notmyfirstn...@planet.nlwrote in messagenews:O2****************@TK2MSFTNGP05.phx.gb l...
Hi,
A queue and a stack are not made for what you ask, I don't know if you
have ever been to England because that is the best place learning what is
a queue.
If you go to a shop you nicely go to the end of the queue, wait until you
are at the end and do your shoping. Maybe you find this normal, however
in England it is real exactly done like this.
A stack is how your program is working.
You have the Main Stack A, that calls another stack B, that calls another
stack C, which is the same as the previous the B. The A is done, the B is
done, the C is done, the B ends, the C ends, the B ends, the A ends. (In
this is a part of recursion)
I hope this gives an idea
Therefore I have the same idea as Tom and use his advice.
Cor
<bucrepusschreef in bericht
news:%2***************@TK2MSFTNGP02.phx.gbl...
>I am trying to create a 'queue', or something like it. I am storing 1 to
6 integers in a list and need to move backwards and forwards in the list
(like the back and forward arrows do in internet explorer, except these
are numbers). I have tried a Stack, queue class, but can't seem to make
them work right moving back forwards / backwards. This list of numbers
will start with no numbers in it and grow to a max of 6 numbers,
depending on how many numbers are added to it.
Thanks a bunch
BUC

Mar 7 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chris Foster | last post by:
I am trying to implement a very fast queue using SQL Server. The queue table will contain tens of millions of records. The problem I have is the more records completed, the the slower it gets....
3
by: Kceiw | last post by:
Dear all, When I use #include "queue.h", I can't link it. The error message follows: Linking... G:\Projects\Datastructure\Queue\Debug\main.o(.text+0x136): In function `main':...
6
by: imutate | last post by:
How do you use std::priority_queue to store say an index type (call it intidx) and sort using another integer type (but smallest weight at the top) ? How do you pop off the top index ? I mean...
4
by: j_depp_99 | last post by:
Thanks to those guys who helped me out yesterday. I have one more problem; my print function for the queue program doesnt work and goes into an endless loop. Also I am unable to calculate the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.