DSA: Queues 2

DSA: Queues 2

More Options: Make a Folding Card

Storyboard Description

This storyboard does not have a description.

Storyboard Text

  • However, a disadvantage for circular queue is that the front and back cannot be used to distinguish between queue-full and queue-empty conditions.
  • So how?
  • Using a counter to keep the number items in the queue. • Initialize count to 0 during creation; Increment count by 1 during insertion; Decrement count by 1 during deletion. • count=0 -> empty; count=MAX_SIZE -> full
  • Is there any other solutions for Queue-Empty/Queue-Full problem?
  • Other approaches include: - using a boolean flag isFull (queue is full, set isFullFlag to true; set isFull flag to false) - Using an extra array location (and leaving at least one empty location in the queue)
  • Your welcome John
  • Alright, thanks for sharing this information with me!
  • The End
More Storyboards By wolfz
Explore Our Articles and Examples

Try Our Other Websites!

Photos for Class   •   Quick Rubric   •   abcBABYart   •   Storyboard That's TPT Store