Which of the following data structures is best suited for implementing a priority queue?
A binary heap is a tree-based data structure that is commonly used to implement priority queues . A binary heap allows efficient insertion of elements and extraction of the minimum or maximum element, depending on whether it is a min-heap or max-heap. Both operations take logarithmic time, making binary heaps optimal for scenarios where priority-based processing is needed, such as in scheduling algorithms or Dijkstra’s shortest path algorithm. A (Incorrect): A stack is a last-in, first-out (LIFO) structure, which is not suitable for maintaining element priorities. B (Incorrect): A queue is a first-in, first-out (FIFO) structure that processes elements in the order they arrive, without considering priority. C (Incorrect): A linked list could be used to implement a priority queue, but its performance would be less efficient than a binary heap, as it requires linear time for insertion and extraction. E (Incorrect): A hash table provides fast lookups but does not maintain any order, making it unsuitable for a priority queue.
150, 158, 131, 195, 70, ?
32, 42, 62, 92, ?, 182
13 13 26 ? 832 13312
...33, ?, 66, 82.5, 99, 115.5
3.6 × 1.5 + 8.4 × 2.5 – 9.2 × 3.5 = ? – 9.2 × 4.4
What will come in place of the question mark (?) in the following series?
24, 25, 34, 59, 108, 189, ?
8, 9, 125, ?, 1331, 169
52, 77, 127, ?, 302, 427
120, 126, 138, 162, ?, 306
72, 97, 147, ?, 322, 447