Recent questions tagged sorting

1 votes
1 answer
511
I am not getting which algorithm has minimum no of swap operations , acc to me both selection and insertion should be at the lowest level as well as merge sort since afte...
6 votes
2 answers
512
Assume that a CPU can process $10^8$ operations per second. Suppose you have to sort an array with $10^6$ elements. Which of the following is true? 1. Insertion sort will...
0 votes
1 answer
513
Suppose we are comparing implementations of insetion sort and merge sort on the same machine. For inputs of size n, insertion sort runs in 8n^2 steps, while merge sort ru...
0 votes
2 answers
515
0 votes
1 answer
516
59 votes
5 answers
517
0 votes
1 answer
522
0 votes
1 answer
523
66 votes
7 answers
525
If we use Radix Sort to sort $n$ integers in the range $\left (n^{k/2}, n^k \right ]$, for some $k 0$ which is independent of $n$, the time taken would be?$\Theta(n)$$\T...
18 votes
2 answers
528
Consider the following sequence of numbers:$$92, 37, 52, 12, 11, 25$$ Use Bubble sort to arrange the sequence in ascending order. Give the sequence at the end of each of ...
35 votes
6 answers
529
For merging two sorted lists of sizes $m$ and $n$ into a sorted list of size $m+n$, we require comparisons of$O(m)$$O(n)$$O(m+n)$$O(\log m + \log n)$
21 votes
2 answers
530
61 votes
10 answers
531
44 votes
4 answers
533
72 votes
14 answers
535
A list of $n$ strings, each of length $n$, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is$O (n \log...
26 votes
3 answers
536
Give the correct matching for the following pairs: $$\begin{array}{ll|ll}\hline \text{(A)} & \text{$O (\log n)$} & \text{(P)} & \text{Selection} \\\hline \text{(B)} & \t...
6 votes
3 answers
537
Array of n elements with first 10 and last 50 elements unsorted..find an algo which runs faster a)merge sort b)quick sort c)insertion sort d)bubble sort Explain
113 votes
9 answers
538
The number of elements that can be sorted in $\Theta(\log n)$ time using heap sort is$\Theta(1)$$\Theta(\sqrt{\log} n)$$\Theta(\frac{\log n}{\log \log n})$$\Theta(\log n)...
31 votes
3 answers
539
Let $A$ be an $n \times n$ matrix such that the elements in each row and each column are arranged in ascending order. Draw a decision tree, which finds $1$st, $2$nd and $...
26 votes
2 answers
540
A sorting technique is called stable ifit takes $O (n \log n)$ timeit maintains the relative order of occurrence of non-distinct elementsit uses divide and conquer paradi...