# Sorting [closed]

150 views
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
closed with the note: solved this..

closed

## Related questions

1 vote
1
740 views
An array $A$ of size n is known to be sorted except for the first $k$ elements and the last $k$ elements, where $k$ is a constant. Which of the following algorithms will be the best choice for sorting the array $A?$ $a)$Insertion Sort $b)$Bubble sort $c)$Quicksort ... ? Quick Sort sorts part by part using pivot. So, why not will it be answer?? How do we know it is asking for almost sorted array??
1 vote