Fix the comma (#1672)
Some checks failed
JavaScript / build (macos-latest) (push) Has been cancelled
JavaScript / build (ubuntu-latest) (push) Has been cancelled
JavaScript / build (windows-latest) (push) Has been cancelled
TypeScript / build (macos-latest) (push) Has been cancelled
TypeScript / build (ubuntu-latest) (push) Has been cancelled
TypeScript / build (windows-latest) (push) Has been cancelled

This commit is contained in:
Peng Chen 2025-02-26 05:08:11 +08:00 committed by GitHub
parent 98cd3a8076
commit f5282698d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,7 +67,7 @@ The overall process of quick sort is shown in the figure below.
## Why is quick sort fast
As the name suggests, quick sort should have certain advantages in terms of efficiency. Although the average time complexity of quick sort is the same as that of "merge sort" and "heap sort", it is generally more efficient for the following reasons.
As the name suggests, quick sort should have certain advantages in terms of efficiency. Although the average time complexity of quick sort is the same as that of "merge sort" and "heap sort," it is generally more efficient for the following reasons.
- **Low probability of worst-case scenarios**: Although the worst time complexity of quick sort is $O(n^2)$, less stable than merge sort, in most cases, quick sort can operate under a time complexity of $O(n \log n)$.
- **High cache utilization**: During the pivot partitioning operation, the system can load the entire sub-array into the cache, thus accessing elements more efficiently. In contrast, algorithms like "heap sort" need to access elements in a jumping manner, lacking this feature.