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

 

Q.15 An array of n numbers is given, where n is an even number. The maximum as well as the minimum of these n numbers needs to be determined. Which of the following is TRUE about the no. of comparisons needed?

(a) Atleast 2n-C comparisons are needed

(b) Atmost 1.5n-2 comparisons are needed

(c) Atleast nlog2 n comparisons are needed

(d) None of the above
 

closed as a duplicate of: GATE2007-50
asked in Algorithms by Loyal (4k points)  
recategorized by | 80 views

1 Answer

+1 vote
Best answer

For even number of elements, comprarisons are option b i.e 1.5n - 2.

Source : http://www.geeksforgeeks.org/maximum-and-minimum-in-an-array/

 

answered by Loyal (3.5k points)  
selected by


Top Users May 2017
  1. akash.dinkar12

    3578 Points

  2. pawan kumarln

    2314 Points

  3. Bikram

    1950 Points

  4. Arjun

    1848 Points

  5. sh!va

    1682 Points

  6. Debashish Deka

    1296 Points

  7. Devshree Dubey

    1282 Points

  8. Arunav Khare

    1122 Points

  9. Angkit

    1072 Points

  10. LeenSharma

    1028 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 May 29 - Jun 04
  1. Arunav Khare

    246 Points

  2. Arjun

    198 Points

  3. pawan kumarln

    108 Points

  4. Niharika 1

    90 Points

  5. pC

    90 Points


22,909 questions
29,242 answers
65,402 comments
27,744 users