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

Explain modulus operator.

0 Answers  


What are the rules for the identifier?

0 Answers  


what is a pointer

4 Answers   Bank Of America, TCS,


Explain how can type-insensitive macros be created?

0 Answers  


What are control structures? What are the different types?

0 Answers  






How are portions of a program disabled in demo versions?

0 Answers  


Explain about the constants which help in debugging?

0 Answers  


Explain what?s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?

1 Answers  


Why ca not I do something like this?

0 Answers  


What is void main ()?

0 Answers  


long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes

18 Answers   Acropolis, HCL, Intel, TCS,


What is the scope of static variables in c language?

0 Answers  


Categories