Data Structure Questions and Answers-Priority Queue

YOU CAN DOWNLOAD 200+ SUBJECTS PDF BOOK FOR COMPETITIVE EXAMINATIONS

CLICK HERE TO DOWNLOAD

Data Structure Questions and Answers-Priority Queue

Question 6 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is not a disadvantage of priority scheduling in operating systems?
A
A low priority process might have to wait indefinitely for the CPU
B
If the system crashes, the low priority systems may be lost permanently
C
Interrupt handling
D
None of the mentioned
Question 6 Explanation: 
It is in fact an advantage, interrupts should be given more priority than the task at hand so that the interrupt can be serviced.

Question 7 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What are the advantages of priority queues?
A
Easy to implement
B
Processes with different priority can be efficiently handled
C
Applications with differing requirements
D
All of the mentioned
Question 7 Explanation: 
All of these properties of priority queue help in achieving its applications like Huffman coding, priority scheduling and the like.

Question 8 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is the time complexity to insert a node based on position in a priority queue?
A
O(nlogn)
B
O(logn)
C
O(n)
D
O(n2)
Question 8 Explanation: 
In the worst case, you might have to traverse the entire list.

There are 8 questions to complete.