Data Structure Heap Question #5765
Single Choice Easy

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

ID: #5765 Heap 183 views
Question Info
#5765Q ID
EasyDifficulty
HeapTopic

Choose the Best Option

Click any option to instantly check if you're correct.

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

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

Challenge a friend or share with your study group.