Why is Quicksort's time complexity O(n log n)?

1 answer

Answer

1207844

2026-03-02 14:20

+ Follow

Quicksort's time complexity is O(n log n) because it divides the input array into smaller subarrays and recursively sorts them. The partitioning step takes O(n) time, and on average, the algorithm splits the array into two equal parts. This results in a logarithmic number of levels in the recursion tree, leading to a time complexity of O(n log n).

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.