79.1k views
5 votes
Which of the following statements are true about quick sort

A. It can degrade into an O(n2) sort if the pivot selection scheme is bad

B. It doesnt require additional memory that merges sort does

C. All other answers

D.in practice it can be transfer than merge sort

1 Answer

6 votes

Answer:

C. All Other answers.

Step-by-step explanation:

The average time complexity of O(nlogn) though it's worst case time complexity is O(n2) if it chooses the pivot that is every time the smallest or the largest.

The quick sort algorithm is inplace means that it does not require additional space.It sorts the array in the array itself using swapping.It does not uses other array for sorting.

The time complexity of merge sort is O(nlogn) and it uses extra space also.So quick sort can be used in place of merge sort since it does not require extra space and have the same time complexity if the pivot selecting scheme is good.

User Greentec
by
8.4k points