Results 1 to 6 of 6

Thread: Queue with circular array

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    27

    Queue with circular array

    hello everyone, i am studding Queue chapter and i have one question from my practice exam. here is the link for practice exam http://www.cs.colorado.edu/~main/questions/chap07j.html

    #11 I have implemented the queue with a linked list, keeping track of a front node and a rear node with two reference variables. Which of these reference variables will change during an insertion into a NONEMPTY queue?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Queue with circular array

    Depends on the insertion spot. If you insert at the front, the front will change. If you insert at the back, the back will change. If you insert in the middle, neither will change.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    27

    Re: Queue with circular array

    yes, you are right. thanks.

  4. #4
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: Queue with circular array

    a queue always inserts at the back right?

    since that is what a queue is supposed to be.

  5. #5
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: Queue with circular array

    unless your data structure is a LIST.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Queue with circular array

    Well, a queue is merely a FIFO container. The first thing you insert is the first thing to come out. Which way you implement it is up to you: you could insert at the back and pop at the front, or vice versa.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width