Solutions for those exercises.
Multiple Choices
-
A queue is generally endowed with operations called…
- Requeue
- Dequeue
- Enqueue
- Unqueue
-
A queue implements which principle?
- LIFO
- FIFO
- LILO
- FOFI
-
LIFO stands for…
- Least Is First Out
- Last Is First Outside
- Last In First Out
- Low Input Fast Output
Exercises
- Suppose given an empty
Queueobject, and assume that we store the values 10 and 20 (in that order), and then remove one and insert 30. Draw the resulting queue, labelling explicitly the front (or beginning) and end of your queue.
Problem
-
This problem is about min-priority queue, i.e., queues where the most important element is the one with the lowest priority. Draw the priority queue after
- Inserting values with priority 10, 2, 5, 7,
- Removing the most important element,
- Inserting values with priority 3, 12,
(you can either draw the queue after each step, or only at the very end)
-
If the queue is implemented using an array.
-
If the queue is implemented using a binary heap.