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
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
In which language linux is written?
Write a program to know whether the input number is an armstrong number.
How do you use a pointer to a function?
Can we change the value of #define in c?
All technical questions
What is bubble sort in c?
What is c language used for?
What will the preprocessor do for a program?
hi send me sample aptitude papers of cts?
Explain how can you determine the size of an allocated portion of memory?
What is the difference between the expression “++a” and “a++”?
What is auto keyword in c?
Why use int main instead of void main?
How do I convert a string to all upper or lower case?