Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


second highest number in a given set of numbers

Answers were Sorted based on User's Feedback



second highest number in a given set of numbers..

Answer / kartik

Read the set of numbers in to an array ,sort it using bubble
sort(ascending order logic),the last but one number wil be
second highest number.....

Is This Answer Correct ?    9 Yes 4 No

second highest number in a given set of numbers..

Answer / suriya

put all nos. in an array and sort it using selection sort in
ascending order the last no. will be the second highest no.

Is This Answer Correct ?    6 Yes 2 No

second highest number in a given set of numbers..

Answer / om

There are two good method to solve this problem; first one
takes 2n-3 comparison and second one takes n+lg(n)-2
comparison only.

1) Run bubble sort loop only for 2 times ..the first time it
will do n-1 comparison and put the largest element at the
end of the array.... then by running second time it will do
n-2 comparison and put the second largest element at the
second last position in the array... so n-1 + n-2 =2n-3
comparison. cool naa... I didn't sort the whole array and
found the second largest element.

2)http://www.seeingwithc.org/topic3html.html
check this site...

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

How is a structure member accessed?

0 Answers  


What will be the result of the following C language program? main() { int a = 0; int b = 20; char x = 1; char y = 10; if(a,b,x,y) printf("Welcome"); }

1 Answers  


Can you apply link and association interchangeably?

0 Answers   InterGraph,


What are runtime error?

0 Answers  


Explain is it better to bitshift a value than to multiply by 2?

0 Answers  


What is define c?

0 Answers  


What is c programing language?

0 Answers  


What is the mean of this statement:: if(int i=0 * i=9)

2 Answers   HCL,


What is actual argument?

0 Answers  


3. When do you say that a digraph is acyclic A)if and only if its first search does not have back arcs B)a digraph is acyclic if and only if its first search does not have back vertices C)if and only if its first search does not have same dfnumber D)None of these

0 Answers   Accenture,


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

0 Answers  


What is the size of a union variable?

0 Answers  


Categories