Recent questions tagged sorting

0 votes
1 answer
301
Space complexity = input size + extra spaceSo, heap sort also takes input of an 'n' size array.Does this mean that space cost of heap sort algo is O (n).
2 votes
3 answers
302
How many comparisons are there for finding any second element that is neither minimum or maximum.10 5 50 70 80 2 3
6 votes
3 answers
303
Q . In the standard merge sort algorithm on a list of size n, what is the maximum number of times an item can be compared?a)2b)lognc)n-1d)NOTMy doubt is here ,Are we cons...
1 votes
2 answers
304
0 votes
1 answer
305
A sorting algorithm is called stable if1.It takes O(n log n) time2.It maintains relative order of occurrence of non-distinct elements3.It uses divide and conquer paradig...
1 votes
3 answers
306
You are asked to sort 15 randomly generated numbers. One should prefer—(a) Bubble sort (b) Quick sort (c) Merge sort (d) Heap sortI think the answer should be c or d cr...
4 votes
2 answers
307
We need to sort 7 numbers each of 4 digits. What is the number of comparisons in worst case . Options are as follows:1) 402) 383) 474) 280
0 votes
1 answer
309
CAn anyone explian about 2-way merge sort ?(You can take example from GATE1999-1.14, ISRO2015-42)
9 votes
5 answers
313
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$
10 votes
5 answers
314
Which one of the following in-place sorting algorithms needs the minimum number of swaps?Insertion SortQuick SortHeap SortSelection Sort
4 votes
1 answer
316
Selection sort is an example of ____(I)_______ and insertion sort is an example of __(II)______.a) I- Greedy, II- Brute Forceb) I- Brute Force II- Divide and conquerc) I-...
0 votes
2 answers
318
Which sorting algorithim is best ifexhactly only half of the elements are in correct position ?
1 votes
3 answers
319
Which sorting algorithm can be used to sort a random linked list with minimum time complexity ?A)mergesortB)quicksortC)radixsortD)insertionsortE)heapsort
2 votes
3 answers
320
0 votes
1 answer
322
why does radix sort uses stable sort i.e counting sort as an intermediate sorting algorithm?
0 votes
2 answers
323
counting sort assumes that each of the n input is an integer in the range 0 to k, for some integer k.please explain when k=O(n), the sort run in O(n) time.
1 votes
1 answer
324
Let there are n elements in array and number of sorted subarray is log n of size n/ log n each thenwhat is the time complexity to sort given array
0 votes
1 answer
325
The tightest lower bound on the number of comparisons, in worst case for comparison based sorting is of the order of ?(A)$n$(B)$n^2$(C)$nlogn$(D)$n \space{log\space n}^2$...
1 votes
1 answer
326
which sorting algorihm is used if we have a telephone directory wit 1,00,000 entries ?
1 votes
1 answer
327
A machine takes 200 second to sort 200 names, using bubble sort . In 800 seconds , it can approximately sort how many names?
0 votes
2 answers
328
Which of the following sorting algorithms has/have minimum running time complexity in best case?I. Selection SortII. Insertion Sorta. Ib. IIc. Both have same minimum runn...
1 votes
1 answer
330