Vidyalelo
Data Structure · Q70

Heaps

Programming · Data Structure · question 70

Q70

State the complexity of algorithm given below. int function(vector arr) int len=arr.length(); if(len==0) return; temp=arr[len-1]; arr.pop_back(); return temp;

A.
o(n)
B.
O(logn)
C.
O(1)
Answer
D.
O(n logn)

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board