in DS recategorized by
431 views
1 vote
1 vote

In a priority queue, insertion and deletion can be done at

  1. Front
  2. back
  3. Middle
  4. Any position
in DS recategorized by
by
431 views

3 Answers

1 vote
1 vote
At any position ,in a priority queue, insertion and deletion can be done. Option D should be correct.
0 votes
0 votes

In a typical priority queue, the insertion and deletion operations are specifically designed to maintain the priority order of elements. Therefore, they are typically done at specific positions to ensure that the highest (or lowest) priority element remains at the front or the root.

The correct answer would be: a) Front

1 comment

I think this question is wrongly framed . Insertion should be from back and deletion should be from front .
0
0
0 votes
0 votes

D

  • Insertion: Elements are inserted based on their priority, and the position may vary depending on the implementation.
  • Deletion: The element with the highest priority is removed. This doesn't necessarily mean removal from the "front" in the sense of a specific position in memory.
  • Insertion can be done at "Any position" based on priority.
  • Deletion typically involves removing the element with the highest priority, and it's not strictly confined to a specific "Front" position.

 

  • Any position is a more accurate choice than "Front" for both insertion and deletion in a priority queue.