find second largest element in array w/o using sorting
techniques? use onle one for loop.
Answer Posted / guest
max = 2ndmax= array[0];
for (i=0;i,length;i++)
{
if (array[i]>max)
{
2ndmax=max;
max=array[i];
}
}
return 2nd max
| Is This Answer Correct ? | 40 Yes | 74 No |
Post New Answer View All Answers
Explain the binary height balanced tree?
What oops means?
What kind of structure is a house?
How can you determine the maximum value that a numeric variable can hold?
find the sum of two matrices and WAP for it.
How can this be legal c?
What is the difference between memcpy and memmove?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
What is the purpose of sprintf?
Why do we need functions in c?
explain what is fifo?
Is c easier than java?
Create a simple code fragment that will swap the values of two variables num1 and num2.
What is class and object in c?
What is variable and explain rules to declare variable in c?