262 views
0 votes
0 votes

Q.  An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is either maximum           or minimum is

A

O(nlogn)

B

O(n)

C

O(logn)

D

O(1)

1 Answer

Best answer
2 votes
2 votes
Since List is unordered , to find out either max or max you need to scan entire list at least one time
so its O(n)
selected by

Related questions

0 votes
0 votes
1 answer
1
tusharb asked Feb 18, 2022
658 views
As we know the time complexity of solving the greedy knapsack algorithm depends mainly on the sorting algorithm used, Can we use counting sort as the sorting algorithm to...
1 votes
1 votes
1 answer
2
sumitr asked Apr 10, 2019
1,263 views
What is the best case and worst case of the algorithm? And when will best case and worst case will happen??int main() { for(i=1 ; i<=n ; i++) { if(n%i == 0) { for(j=1 ; j...
0 votes
0 votes
1 answer
3
eyeamgj asked Aug 25, 2018
460 views
suppose we are given a sorted array ....and we need to extract minimum every tym what is the time complexity??and what is the tym complexity to delete the minimum ? are ...