Sail E0 Webinar
Question
State the complexity of algorithm given belowint function(vector arr) int len=arr.length(); if(len==0) return; temp=arr[len-1]; arr.pop_back(); return temp;
Options:
A .  o(n)
B .  O(logn)
C .  O(1)
D .  O(n logn)
Answer: Option C


Deletion in a min-heap is in O(1) time.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers