Recent questions tagged sorting

0 votes
1 answer
335
2 votes
1 answer
337
Minimum time taken to find median of a list of numbers isO(log n)O(n)O(n log n)O (n2)
1 votes
1 answer
338
Which of the following algorithm have the smallest memory requirement i.e Low space complexity including data space and run time stack for recursive calls.A)insertion sor...
0 votes
1 answer
340
Best algorithm for this set:1.Independently sorting each of 1,000,000 arrays, each with 5 elements.2.Sorting a set of 4,000,000 numbers in worst case O(n lg n) time.
0 votes
2 answers
341
0 votes
1 answer
343
which of the following methods will be the best if number of swappings done, is the only measure of efficiency?A) Bubble sort B) Selection sortC) Insertion so...
1 votes
1 answer
346
Which of the following sorting algorithms has the lowest best-case asymptotic algorithmic complexity?Selection sortMerge sortInsertion sortHeap sort
2 votes
2 answers
349
as we already know the range,so can we use counting sort??and complexity of counting sort is O(n+k)what other method is there to know the missing number??
0 votes
2 answers
350
Consider X[1, ..., n] and Y[1, ..., n] be two arrays each containing n-numbers both of which are already sorted. What is the time complexity to find median by combining t...
2 votes
1 answer
351
If we use quicksort algorithm to sort the elements: $16, 13, 14, 12, 21, 16, 23$ and $15$ in ascending order, what is the output after the first pass of quicksort? (Assum...
2 votes
1 answer
352
As part of maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be...
0 votes
4 answers
355
2 votes
1 answer
356
0 votes
1 answer
357
INSERTION-SORT (A, n) ⊳ A[1 . . n]for (j ← 2 to len(A) ){key ← A[ j];i ← j – 1 ; while (i 0 and A[i] key) { A[...
0 votes
2 answers
358
0 votes
1 answer
359
0 votes
1 answer
360