Question DSA-HEAP-0003
EasyWhich data structure is usually used to implement a priority queue?
- A.
Linked list only
- B.
Hash table
- C.
Show answer and explanation
Answer: D
Heaps give O(log n) insert and extract-min/max and O(1) peek.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Heaps and Priority Queues question
Which data structure is usually used to implement a priority queue?
Linked list only
Hash table
Answer: D
Heaps give O(log n) insert and extract-min/max and O(1) peek.
Stack
Binary heap