77.0k views
0 votes
What is the efficiency (Big O Notation) of quicksort algorithm?

User MattjeS
by
5.6k points

1 Answer

0 votes

Answer:

O(NlogN)

Step-by-step explanation:

The time complexity of quick sort in worst case is O(N²) but the average case time complexity of quick sort is O(NLogN).The efficiency of quick sort totally depends upon the pivot.If the pivot is the smallest or the largest element in the array every time then the time complexity of quick sort algorithm will come out to be O(N²).

User Siraj
by
4.9k points