Sorting
closed

• closed by
665 views
0 0 votes
closed with the note: solved this..
Let P be a Quicksort Program to sort numbers in ascending order using the first element as
pivot. Let t1 and t2 be the number of comparisons made by P for the inputs {1, 2, 3, 4, 5} and {4,1, 5, 3, 2} respectively. Which one of the following holds?
A. t1 = 5 B. t1< t2
C. t1> t2 D. t1 = t2
Position:
Show:

Related questions

9 9 votes
6 6 answers
4.0k
4.0k views
Arjun asked Feb 27, 2025
3,970 views
Suppose that insertion sort is applied to the array $[1,3,5,7,9,11, x, 15,13]$ and it takes exactly two swaps to sort the array. Select all possible values of $x$.$10$$12...
1 1 vote
1 1 answer
145
145 views
GO Classes asked Aug 25
145 views
Let $P$ be the problem of sorting $n\geq1$ elements using only comparisons.Consider the class of all comparison-based algorithms that correctly solve $P$.What is the asym...
2 2 votes
2 2 answers
191
191 views
GO Classes asked Aug 11
191 views
Problem: Sort a file of huge records with tiny keys.Example application: Reorganize your MP-$3$ files.Which sorting method to use?a system sort, guaranteed to run in time...
1 1 vote
1 1 answer
127
127 views
GO Classes asked Aug 10
127 views
You need to sort hotels on a travel website according to their star rating.Which sorting algorithm would be the most appropriate?Insertion sort Merge sort Quicksort Bucke...