Single Choice Easy

QWhat is the time complexity of inserting an element into a heap data structure?

ID: #21495 Time Complexity 86 views
Question Info
#21495Q ID
EasyDifficulty
Time ComplexityTopic

Choose the Best Option

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

  • A O(1)
  • B O(log N)
  • C O(N)
  • D O(N^2)
Correct Answer

Explanation

Inserting an element into a heap has a time complexity of O(log N) where N is the number of elements in the heap.

Share This Question

Challenge a friend or share with your study group.