algoritmauzmanı
Sign in
TREN
Subtopic 5.5

Priority Queue

6lessons34 min0done

In a elements leave by priority rather than by arrival order. Triage in an emergency room and job scheduling in an operating system work this way.

The subtopic first explains the idea. Then it codes insertion and removal twice: with a sorted array and with a sorted linked list. The last lesson compares them with an unsorted array and a heap, and says which to pick when.

Lesson 5.5.1 What is a priority queue?6 min