Question: In a priority queue implemented with a binary heap, what is the time complexity for inserting an element?
Options:
Correct Answer: O(log n)
Solution:
Inserting an element into a binary heap takes O(log n) time due to the need to maintain the heap property after the insertion.