Queue or the sorts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    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


  • Tom Shelton

    #2
    Re: Queue or the sorts

    On Mar 6, 2:07 pm, <bucrepuswrot e:
    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

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: Queue or the sorts

      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


      <bucrepusschree f in bericht news:%235brAODY HHA.992@TK2MSFT NGP02.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
      >

      Comment

      • RobinS

        #4
        Re: Queue or the sorts

        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]" <notmyfirstname @planet.nlwrote in message
        news:O2K%23MnHY HHA.4552@TK2MSF TNGP05.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
        >
        >
        <bucrepusschree f in bericht
        news:%235brAODY HHA.992@TK2MSFT NGP02.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
        >>
        >
        >

        Comment

        • aaron.kempf@gmail.com

          #5
          Re: Queue or the sorts

          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:O2K %23MnHYHHA.4552 @TK2MSFTNGP05.p hx.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
          >
          <bucrepusschree f in bericht
          news:%235brAODY HHA.992@TK2MSFT NGP02.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

          Comment

          Working...