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:
Question 6 |
The number of swappings needed to sort the numbers 8 , 22, 7, 9, 31, 5, 13 in ascending order using bubble sort is
11 | |
12 | |
13 | |
10 |
Question 6 Explanation:
Question 7 |
Which one of the following in-place sorting algorithms needs the minimum number of swaps?
Insertion Sort | |
Quick Sort | |
Heap Sort | |
Selection Sort |
Question 7 Explanation:
Question 8 |
Algorithm design technique used in quicksort algorithm is?
Dynamic programming | |
Backtracking | |
Divide and conquer | |
Greedy method |
Question 8 Explanation:
Question 9 |
Assume that the algorithms considered here sort the input sequences in ascending order. If the input is already in ascending order, which of the following are TRUE?
I. Quicksort runs in \Theta (n^{2}) time
II. Bubblesort runs in \Theta (n^{2}) time
III. Merge sort runs in \Theta (n) time
IV. Insertion sort runs in \Theta (n) time
I. Quicksort runs in \Theta (n^{2}) time
II. Bubblesort runs in \Theta (n^{2}) time
III. Merge sort runs in \Theta (n) time
IV. Insertion sort runs in \Theta (n) time
I and II only | |
I and III only | |
II and IV only | |
I and IV only |
Question 9 Explanation:
Question 10 |
The worst case running times of Insertion sort, Mergesort and Quicksort, respectively, are:
\Theta(n logn), \Theta(n logn), and \Theta(n^{2}) | |
\Theta (n^{2}),\Theta(n^{2}), and \Theta (n logn) | |
\Theta (n^{2}),\Theta(n logn), and \Theta (n logn) | |
\Theta (n^{2}),\Theta(n logn), and \Theta (n^{2}) |
Question 10 Explanation:
There are 10 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)