Which of the following sorts is quickest when sorting the
following set: 1 2 3 5 4




1) Quick Sort


2) Bubble Sort


3) Merge Sort

Answer Posted / khushboo

BUbble sort

Quick Sort will take nlogn time and also merge sort

But bubble sort will take only O(n) as we can detect no
shift of position in first scan itself...

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a pointer be null?

565


What is the difference between malloc() and calloc() function in c language?

604


Can you define which header file to include at compile time?

589


How does normalization of huge pointer works?

641


What are the loops in c?

593






what value is returned to operating system after program execution?

1606


Define the scope of static variables.

606


Can a void pointer point to a function?

573


What is strcpy() function?

657


What is c language used for?

559


How to get string length of given string in c?

609


Explain what happens if you free a pointer twice?

613


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

579


What is spark map function?

581


What are pragmas and what are they good for?

577