The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
231 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 (4.7k points)
recategorized by | 231 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 (4k points)
selected by


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

28,831 questions
36,676 answers
90,578 comments
34,638 users