Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Queue using c#

Queue using c#

Scheduled Pinned Locked Moved C#
csharpdata-structureshelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Angelinna
    wrote on last edited by
    #1

    Seeking help with (i) method/ c# code to remove every second item in a queue I tried front.next = front.next.next but it this is removing only one second item just after the first but would like to remove every other second item/element through out the queue. (ii) c# code for reversing a queue . :confused:

    T A 2 Replies Last reply
    0
    • A Angelinna

      Seeking help with (i) method/ c# code to remove every second item in a queue I tried front.next = front.next.next but it this is removing only one second item just after the first but would like to remove every other second item/element through out the queue. (ii) c# code for reversing a queue . :confused:

      T Offline
      T Offline
      The Only Nock
      wrote on last edited by
      #2

      (ii) A queue is a first in first out type right? So take a queue that you want reversed and put it into a stack. Then move the stack to a new queue. This will reverse the queue.

      A 1 Reply Last reply
      0
      • T The Only Nock

        (ii) A queue is a first in first out type right? So take a queue that you want reversed and put it into a stack. Then move the stack to a new queue. This will reverse the queue.

        A Offline
        A Offline
        Angelinna
        wrote on last edited by
        #3

        How do I put all that into C# code?

        1 Reply Last reply
        0
        • A Angelinna

          Seeking help with (i) method/ c# code to remove every second item in a queue I tried front.next = front.next.next but it this is removing only one second item just after the first but would like to remove every other second item/element through out the queue. (ii) c# code for reversing a queue . :confused:

          A Offline
          A Offline
          Alan Balkany
          wrote on last edited by
          #4

          This sounds like a homework problem. Even if someone here did it for you, you still wouldn't be able to do future (and harder!) problems. Use an easy problem like this to develop your programming skills. Figure out the procedure you'd use to solve this with pen and paper. Then figure out how to implement this algorithm with C#.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups