Sorting Algorithms:
Sorting means:
👉 Arranging data in order (small → big or big → small)
Example:
[5, 2, 9, 1] → [1, 2, 5, 9]
Common Sorting Types:
1 Bubble Sort
Compare and swap values
Simple but slow
👉 Time: O(n²)
2 Selection Sort
Find smallest and place it first
👉 Time: O(n²)
3 Quick Sort (Important)
Divide and sort
👉 Time: O(n log n) (fast)
💡 Simple idea:
Small data → any sort works
Big data → use Quick Sort