Question

What are the chief differences between these three data structures? How can you determine when it is appropriate to use...

What are the chief differences between these three data structures? How can you determine when it is appropriate to use a queue, a dequeue, or a priority queue?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Queue- Is a data structure allows to insert elements at rear end , and to delete at front end.

Where as dequeue is a doubly ended queue which allows to insert and delete from both the ends . It can be viewed as hybrid datastructure, as a combination of stack and queue.

Priority queue: This datastructure is used to maintain elements in priority order. So that high priority element is removed from the queue to process it.when we insert an element into priority a queue , based on priority it is placed in queue, thus it is a priority queue.

Quoue To insut and dale t in FIFO orda applcatton aaquines fint . in- fint Whan out Orde, then Queu rea Yea lo5 end, deletef

priogsty |Kay 5 1. eleti lo5 23/4 10 Рiожy фикиа 23

To implement first come first serve schedule in any application like ticket booking system, then Queue is used.

To implement both Last in first out and first in first out with out restricted to one end then dequeue is used.

To implement priority based scheduling in hospitals , like emergency cases are given priority. to execute high priority process in operating system then priority queue is used.

Add a comment
Know the answer?
Add Answer to:
What are the chief differences between these three data structures? How can you determine when it is appropriate to use...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT