Question 1 |

Consider the following array.

\begin{array}{|l|l|l|l|l|l|l|l|} \hline 23&32&45&69&72&73&89&97 \\ \hline\end{array}

Which algorithm out of the following options uses the least number of comparisons (among the array elements) to sort the above array in ascending order?

\begin{array}{|l|l|l|l|l|l|l|l|} \hline 23&32&45&69&72&73&89&97 \\ \hline\end{array}

Which algorithm out of the following options uses the least number of comparisons (among the array elements) to sort the above array in ascending order?

Selection sort | |

Mergesort | |

Insertion sort | |

Quicksort using the last element as pivot |

Question 1 Explanation:

Question 2 |

Of the following sort algorithms, which has execution time that is least dependant on initial ordering of the input?

Insertion sort | |

Quick sort | |

Merge sort | |

Selection sort |

Question 2 Explanation:

Question 3 |

An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot element gets placed in the worst possible location in the first round of partitioning (rounded off to 2 decimal places) is _________.

0.08 | |

0.0016 | |

0.04 | |

0.0008 |

Question 3 Explanation:

Question 4 |

Of the following sorting algorithms, which has a running time that is least dependent on the initial ordering of the input?

Mege Sort | |

Insertion Sort | |

Selection Sort | |

Quick Sort |

Question 4 Explanation:

Question 5 |

Given two sorted list of size m and n respectively. The number of comparisons needed the worst case by the merge sort algorithm will be:

m-n | |

maximum of m and n | |

minimum of m and n | |

m+n-1 |

Question 5 Explanation:

There are 5 questions to complete.

Question number 17 option d should be n^3 instead of n ^2

Thank You PRAFUL SAMBHAJI RANE,

We have updated the option.

Question 41 should be option B (C1=C2) as both are worst case of Quicksort with equal comparisons = O(n^2)