Skip to main content

Sorting

🤖WARNING
The English translation was done by AI.

Bubble Sort (O(n^2)/O(1))

LeetCode, compares adjacent elements and moves the larger ones to higher positions.

Quick Sort (O(nlogn)/O(logn))

Keywords: Divide and conquer, sorting/searching

LeetCode, achieves overall and local order, selects a pivot element, moves elements smaller than the pivot to the left, and moves elements larger than the pivot to the right.