What are the average number of comparisons required to sort
3 elements?

Answers were Sorted based on User's Feedback



What are the average number of comparisons required to sort 3 elements?..

Answer / jaiprakash

n(n-1)/2(bubble sort)
n=3
(3*2)/2=3(n)

ans:n

Is This Answer Correct ?    13 Yes 1 No

What are the average number of comparisons required to sort 3 elements?..

Answer / hell2heaven

I think answer is 3.is it right?

Is This Answer Correct ?    12 Yes 1 No

Post New Answer

More C Interview Questions

What is C++

4 Answers  


why i join syntel?

23 Answers   ABC, Syntel, TCS,


where does malloc() function get the memory?

1 Answers  


If "AaBbCc" is passed to the char char x(*a) { a[0]?x(a+1):1; printf("%c",a[0]); return 1; } what will be the output?

6 Answers   Hughes,


what will be the output off the following program? #include<stdio.h> int main() { int a; a=015+0*71+5; printf("%d,a"); return0; }

9 Answers   HCL,






What is a protocol in c?

0 Answers  


write a c code "if you give a any decimal number then print that number in english alphabet"? ex: i/p: 552 o/p: five hundred fifty two ...

1 Answers   Philips,


What is the use of function in c?

0 Answers  


what is the output of below int n=10; (n++)++; printf("%d",n);

3 Answers  


find out largest elemant of diagonalmatrix

0 Answers  


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

0 Answers  


What is pass by reference in c?

0 Answers  


Categories