148k views
1 vote
Which of the following data structures can be used to implement the priority queue abstract data type? (Select all that apply.)

A) Basic array
B) Binary heap
C) Self-balancing binary search tree
D) Linked list

1 Answer

4 votes

Final answer:

Binary heap, self-balancing binary search tree, and linked list.

Step-by-step explanation:

The data structure options that can be used to implement the priority queue abstract data type are:

  • Binary heap: A binary heap is a complete binary tree that satisfies the heap property. The heap property ensures that the highest priority element is always at the root of the tree.
  • Self-balancing binary search tree: A self-balancing binary search tree, such as an AVL tree or a red-black tree, can be used to implement a priority queue. These trees maintain a balanced structure automatically, which helps ensure efficient operations.
  • Linked list: A linked list can also be used to implement a priority queue, although it may not be as efficient as the other options. However, it provides flexibility in terms of insertion and deletion.

User Le Khiem
by
8.9k points