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

Answer Posted / jaiprakash

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

ans:n

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

731


Can you please explain the difference between malloc() and calloc() function?

623


Explain how can I make sure that my program is the only one accessing a file?

635


What are logical errors and how does it differ from syntax errors?

663


What is "Hungarian Notation"?

639






Is main an identifier in c?

607


Explain the ternary tree?

605


Write a program to generate the Fibinocci Series

673


why we wont use '&' sing in aceesing the string using scanf

1787


What is c definition?

754


When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?

811


Which header file should you include if you are to develop a function which can accept variable number of arguments?

815


What are the advantages and disadvantages of pointers?

584


Explain the use of 'auto' keyword

683


What is your stream meaning?

610