GATE CSE
First time here? Checkout the FAQ!
x
0 votes
30 views

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)

asked in Algorithms by (325 points)   | 30 views

1 Answer

+2 votes
Best answer
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)
answered by Active (1.2k points)  
selected by


Top Users Aug 2017
  1. ABKUNDAN

    4670 Points

  2. Bikram

    4412 Points

  3. akash.dinkar12

    3390 Points

  4. rahul sharma 5

    3072 Points

  5. manu00x

    2682 Points

  6. makhdoom ghaya

    2430 Points

  7. just_bhavana

    2130 Points

  8. Tesla!

    1932 Points

  9. stblue

    1806 Points

  10. joshi_nitish

    1620 Points


24,935 questions
32,039 answers
74,447 comments
30,125 users