Data Structure Heap MCQ Details
MCQ Practice Single Best Answer Topic: Heap

Q What is the time complexity of inserting an element into a binary heap of n elements?

Question ID
#5765
Subchapter
Heap
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A O(n)
  • B O(log n)
  • C O(n log n)
  • D O(1)
Correct Answer: B

Explanation

Answer: b) O(log n)

Explanation: The time complexity of inserting an element into a binary heap of n elements is O(log n).

Share This Question

Share this MCQ with your friends or study group.