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
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:
parent
98cd3a8076
commit
f5282698d5
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user